infragram web app development

60 views
Skip to first unread message

Don Blair

unread,
May 21, 2013, 3:31:51 PM5/21/13
to plots-i...@googlegroups.com
Hi Folks!

So far, we've got implemented Craig's ndvi analysis code (modulo some changes), and it's running in a very basic way here:


I've started a wiki page on infragram webapp development here:

My relevant code is here:

(I'll have to write up a how-to-install guide on the wiki / in a Readme, but I basically just followed the links referenced in the "Using Flask, Twitter Bootstrap, and Heroku" section of the wiki)

It's currently just a test, but the background code is in fact taking a sample image, stored on the server (same as attached), and running Craig's python script on it to generate NDVI (with a particular, poor choice of color table).  The image you see on the site is the result.  Every time you reload the page, it is generating the file anew.

Next steps:
- Add PIL library to enable JPEG processing (matlab can only do PNG itself, it seeems)
- Refine the python processing code, with a nice color table, etc
- Enable 'upload file' feature (drag and drop using HTML5?) -- there are some promising refs on how to do this on the above wiki ...

Exciting stuff ...

Cheers,
Don
--
web: http://dwblair.github.io <---- info, projects, docs, etc
skype: dwingateb
voice & SMS: +1-651-252-4765
twitter: @donwblair

Alex Mandel

unread,
May 21, 2013, 5:56:10 PM5/21/13
to Don Blair, plots-i...@googlegroups.com
On 05/21/2013 12:31 PM, Don Blair wrote:
> Hi Folks!
>
> So far, we've got implemented Craig's ndvi analysis code (modulo some
> changes), and it's running in a very basic way here:
>
> http://infrapix.herokuapp.com/
>
> I've started a wiki page on infragram webapp development here:
> http://publiclab.org/wiki/infragram-webapp-dev
>
> My relevant code is here:
> https://github.com/dwblair/infrapix
>
> (I'll have to write up a how-to-install guide on the wiki / in a Readme,
> but I basically just followed the links referenced in the "Using Flask,
> Twitter Bootstrap, and Heroku" section of the wiki)
>
> It's currently just a test, but the background code is in fact taking a
> sample image, stored on the server (same as attached), and running Craig's
> python script on it to generate NDVI (with a particular, poor choice of
> color table). The image you see on the site is the result. Every time you
> reload the page, it is generating the file anew.
>
> Next steps:
> - Add PIL library to enable JPEG processing (matlab can only do PNG itself,
> it seeems)


You meant matplotlib? I'll suggest you might want to use Pillow instead
of PIL for forward compatibility reasons
https://pypi.python.org/pypi/Pillow/2.0.0

Also I think png is a good format, 2nd would be tiff, and 3rd jpeg since
jpeg is lossy (Does JPEG support 4+ bands?). My perspective on this
comes from the ability to use the images in additional analysis after
the fact. JPEG is only really nice for display purposes.

Thanks,
Alex


Craig Versek

unread,
May 21, 2013, 6:13:00 PM5/21/13
to te...@wildintellect.com, Don Blair, plots-i...@googlegroups.com
matplotlib > pylab > matlab

Yes, I would hope we aren't degenerating to non-open softwares.

JPEG is lossy, but that's the format from many cameras we are modding.  We can easily convert into PNG and perhaps should for some purposes.  The increased processing time associate with trying to capture directly to a (compressed) PNG on low power systems like the RPi and Beaglebone let us to stick with JPEG until a better alternative was needed.

Thanks for the tip about Pillow,  PIL does see a little dated at this point.

- Craig




--
You received this message because you are subscribed to the Google Groups "plots-infrared" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plots-infrared+unsubscribe@googlegroups.com.
To post to this group, send email to plots-infrared@googlegroups.com.
Visit this group at http://groups.google.com/group/plots-infrared?hl=en.



Jeffrey Warren

unread,
May 21, 2013, 6:51:05 PM5/21/13
to Don Blair, plots-i...@googlegroups.com
Cool - maybe a next step could be getting it to read an image at a given URL (http://infrapix.herokuapp.com?img=http://foo.com/image.jpg) and just convert and display it without saving it. That could get us a useful tool with minimal infrastructure.

Re: alex's suggestion -- eventually we could store "source" images separately from "composites". But I like the idea of getting a simple working tool first and exploring all the nice features later. Great amazing super work y'all!

Jeff


--
You received this message because you are subscribed to the Google Groups "plots-infrared" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plots-infrare...@googlegroups.com.
To post to this group, send email to plots-i...@googlegroups.com.

Don Blair

unread,
May 24, 2013, 11:20:50 AM5/24/13
to Jeffrey Warren, plots-i...@googlegroups.com
Sorry I missed the follow-up on this thread ...

Alex -- great catch re: Pillow, thanks for that!  Looks like that's the way forward for this webapp ...


On Tue, May 21, 2013 at 6:51 PM, Jeffrey Warren <je...@publiclab.org> wrote:
Cool - maybe a next step could be getting it to read an image at a given URL (http://infrapix.herokuapp.com?img=http://foo.com/image.jpg) and just convert and display it without saving it. That could get us a useful tool with minimal infrastructure.

Re: alex's suggestion -- eventually we could store "source" images separately from "composites". But I like the idea of getting a simple working tool first and exploring all the nice features later. Great amazing super work y'all!

Jeff
On Tue, May 21, 2013 at 3:31 PM, Don Blair <dwb...@physics.umass.edu> wrote:

--
You received this message because you are subscribed to the Google Groups "plots-infrared" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plots-infrare...@googlegroups.com.
To post to this group, send email to plots-i...@googlegroups.com.
Visit this group at http://groups.google.com/group/plots-infrared?hl=en.
 
 

Don Blair

unread,
May 25, 2013, 4:27:08 PM5/25/13
to Jeffrey Warren, plots-i...@googlegroups.com
Update -- still figuring out Flask ... and had some errors I didn't understand with Heroku ... so I moved things over to the PVOS server for the time being.  Advantage: a bit more control over things (I think).  Disadvantage: scaling up isn't as straigthforward (I think) ...

In any case, check out the super-minimal test here:


Next step: fix / enhance the color maps (incorporate Craig's new Gaussian code ...)

Cheers,
Don

Don Blair

unread,
May 25, 2013, 4:27:55 PM5/25/13
to Jeffrey Warren, plots-i...@googlegroups.com
(aside: still only accepts PNG for now, and probably best to keep the images under 2 MB ...)

Chris Fastie

unread,
May 25, 2013, 4:39:12 PM5/25/13
to plots-i...@googlegroups.com
I just processed a jpg image that was 1.5 MP. (It did not like the 16 MP version.) That's cool. It even looks like the result of Ned's plugin. Nice work.
Here is my NDVI from it: 

Don Blair

unread,
May 25, 2013, 4:48:33 PM5/25/13
to Chris Fastie, plots-i...@googlegroups.com
Wow, thanks for trying it out so quickly -- I find it hard to believe that it worked! :) 

I believe the links *might* have been persistent, if I hadn't just cleaned out the relevant folders (while cleaning up for an initial github commit -- shouldn't happen again).  Can you give it another shot, when you get a chance?



--
You received this message because you are subscribed to the Google Groups "plots-infrared" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plots-infrare...@googlegroups.com.
To post to this group, send email to plots-i...@googlegroups.com.
Visit this group at http://groups.google.com/group/plots-infrared?hl=en.
 
 

Chris Fastie

unread,
May 25, 2013, 4:57:03 PM5/25/13
to plots-i...@googlegroups.com
Okay, that link should work again. And this one too: http://infrapix.pvos.org/show/IMG_3354_1400.jpg


On Saturday, May 25, 2013 4:48:33 PM UTC-4, Don Blair wrote:
Wow, thanks for trying it out so quickly -- I find it hard to believe that it worked! :) 

I believe the links *might* have been persistent, if I hadn't just cleaned out the relevant folders (while cleaning up for an initial github commit -- shouldn't happen again).  Can you give it another shot, when you get a chance?

Don Blair

unread,
May 25, 2013, 5:02:02 PM5/25/13
to Chris Fastie, plots-i...@googlegroups.com
Oooh, fun!  It does indeed look like it works!  Thanks for uploading that!

Any associated awesomeness in the image processing is due to Craig's code; this is all just a web-based wrapper around his nicely-wrought matplolib function.

But, golly -- this means we can now run python code in the browser.  This is going to be fun!  And the same code should run on an RPi / laptop / etc ...

The associated git repository is here:


-- maybe we can use the 'issues' feature in that repo as a way of tracking problems / features?



--
You received this message because you are subscribed to the Google Groups "plots-infrared" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plots-infrare...@googlegroups.com.
To post to this group, send email to plots-i...@googlegroups.com.
Visit this group at http://groups.google.com/group/plots-infrared?hl=en.
 
 

Don Blair

unread,
May 25, 2013, 5:18:16 PM5/25/13
to Chris Fastie, plots-i...@googlegroups.com
Oh, and it just registered with me that the service *is*, in fact, processing JPG files (as per the example Chris sent).  Didn't think that would work, yet, but: I'll take it!

Don Blair

unread,
May 25, 2013, 6:28:30 PM5/25/13
to Chris Fastie, plots-i...@googlegroups.com
Update -- we're now also generating "NIR" output:  that is, only the red channel info, using a gray colormap ... check it out here:

Craig Versek

unread,
May 25, 2013, 6:32:23 PM5/25/13
to Don Blair, Chris Fastie, plots-i...@googlegroups.com
The "asphalt river"...

Chris Fastie

unread,
May 25, 2013, 10:21:55 PM5/25/13
to plots-i...@googlegroups.com
Here is a call to include on the web app a sandbox for having fun and making art from infrared images.  The image below started as Jeff's awesome superblue "Asphalt River" photo and was manipulated with the sliders in Photoshop's Channel Mixer. This is fun with normal RGB photos, but even cooler when one channel in IR.

The mixer allows you to determine the mix of the R, G, and B channels to be output as each of the three channels of a new image.  Here is what the mixer looks like:



Chris Fastie

unread,
May 26, 2013, 12:14:27 AM5/26/13
to plots-i...@googlegroups.com
Switching channels in superblue photos is fun. These also got some hue and saturation love. This was another of Jeff's handsome Fresh Pond Rosco photos.



Don Blair

unread,
May 26, 2013, 9:29:34 AM5/26/13
to Chris Fastie, plots-i...@googlegroups.com
Oooh!

Brilliant idea.  These images are gorgeous. And the interactive sliders as a way of deciding which incoming channels end up in which outgoing channels in which proportions might also be a nice, visual, hands-on way of conveying the concepts underlying NDVI and related analyses.  

I'll dig into 'javascript sliders'!




--
You received this message because you are subscribed to the Google Groups "plots-infrared" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plots-infrare...@googlegroups.com.
To post to this group, send email to plots-i...@googlegroups.com.
Visit this group at http://groups.google.com/group/plots-infrared?hl=en.
 
 

Don Blair

unread,
May 26, 2013, 3:35:25 PM5/26/13
to Chris Fastie, plots-i...@googlegroups.com
I added almost completely non-functioning sliders!



Jeffrey Warren

unread,
May 26, 2013, 6:40:34 PM5/26/13
to Don Blair, Chris Fastie, plots-i...@googlegroups.com
I'm getting a 500 internal server error -- maybe my ~2.5mb images are too big? I have some great ones from my flight back from Colorado.

Jeffrey Warren

unread,
May 26, 2013, 6:45:08 PM5/26/13
to Don Blair, Chris Fastie, plots-i...@googlegroups.com
filesize was the problem, then a space in the filename; i created issues here: https://github.com/dwblair/infrapix/issues/1https://github.com/dwblair/infrapix/issues/2

And got it to run! http://infrapix.pvos.org/show/IMG_0023_small.JPG but not in very high resolution.

Are you going to GPL or BSD the code? I'd love to pitch in!

Don Blair

unread,
May 26, 2013, 6:45:17 PM5/26/13
to Jeffrey Warren, Chris Fastie, plots-i...@googlegroups.com
ah, sorry! -- right now the dreamhost server only has enough memory for files of around 2MB -- will be planning to assess filesize on upload and give a "sorry, can't do that, dave" message ... 

Don Blair

unread,
May 26, 2013, 6:48:07 PM5/26/13
to Jeffrey Warren, Chris Fastie, plots-i...@googlegroups.com
Ooh, how cool is that! http://infrapix.pvos.org/uploads/ndvi_IMG_0023_small.JPG

Yes, please!  It'll really start going somewhere when you pitch in! :)

GPL coming up right away ... (oops)!



On Sun, May 26, 2013 at 6:45 PM, Jeffrey Warren <je...@publiclab.org> wrote:
filesize was the problem, then a space in the filename; i created issues here: https://github.com/dwblair/infrapix/issues/1https://github.com/dwblair/infrapix/issues/2

And got it to run! http://infrapix.pvos.org/show/IMG_0023_small.JPG but not in very high resolution.

Are you going to GPL or BSD the code? I'd love to pitch in!

Don Blair

unread,
May 26, 2013, 6:53:42 PM5/26/13
to Jeffrey Warren, Chris Fastie, plots-i...@googlegroups.com
Having not really done this sort of thing before, I'm a bit confused re: the various options / licenses.  Just did some quick reading on GPL vs. BSD vs. etc ...

Which license do you think is most useful for PL re: code like this? 

Jeffrey Warren

unread,
May 26, 2013, 7:05:56 PM5/26/13
to Don Blair, Chris Fastie, plots-i...@googlegroups.com
a *really* fast summary might be that the GPL requires later versions and contributions to be licensed GPL also, BSD and similar licenses do not carry that requirement. It's a bit like "sharealike"

Don Blair

unread,
May 26, 2013, 7:16:39 PM5/26/13
to Jeffrey Warren, Chris Fastie, plots-i...@googlegroups.com
Okay cool, thanks -- I'll stick GPL on there, and away we go ...


On Sun, May 26, 2013 at 7:05 PM, Jeffrey Warren <je...@publiclab.org> wrote:
a *really* fast summary might be that the GPL requires later versions and contributions to be licensed GPL also, BSD and similar licenses do not carry that requirement. It's a bit like "sharealike"

Don Blair

unread,
May 26, 2013, 7:28:11 PM5/26/13
to Jeffrey Warren, Chris Fastie, plots-i...@googlegroups.com
GNU-d up!

And Jeff, feel free to start running it on the PL servers as soon as is convenient / desirable ... will try to reconfigure things so that it's pared-down, minimalist, and more stable ... 

Craig Versek

unread,
May 26, 2013, 7:43:15 PM5/26/13
to Don Blair, Jeffrey Warren, Chris Fastie, plots-i...@googlegroups.com
I've just posted instructions on how to get the latest committed version (on GitHub) of the infrapix webapp running locally on a Debian-style system: http://publiclab.org/wiki/infragram-webapp-dev#Installing+Local+Virtualenv+Dev.+Environment

Small changes will need to be made if more dependencies are added.  Let me know if any step doesn't work and if you have a workaround.

-  Craig

Craig Versek

unread,
May 26, 2013, 7:45:53 PM5/26/13
to Don Blair, Jeffrey Warren, Chris Fastie, plots-i...@googlegroups.com
uhh... I've since tweaked the name of that sublink, heres the new one:
http://publiclab.org/wiki/infragram-webapp-dev#Installing+into+Local+Virtualenv+Development+Environment

Don Blair

unread,
Jun 3, 2013, 4:28:22 PM6/3/13
to Craig Versek, Jeffrey Warren, Chris Fastie, plots-i...@googlegroups.com
Hi Folks,

Here's the latest version of the web app:


We've moved the repo to make it easier for us to collaborate:

This is the new place to add "issues" re: requests for features, bugs, etc ...

Today I fixed the 'spaces in filenames' issue Jeff found, simplified the web page that is returned to the user (no mockup extra fancy features now, just the currently-functional features), and fixed the 'letterboxing' issue in the final images.

If the basics are up to snuff, maybe the code can be installed on a PL server as a demo for the community (or we can wait till it's a bit prettier ...)

Whee!
D

On Sun, May 26, 2013 at 7:45 PM, Craig Versek <cve...@physics.umass.edu> wrote:
uhh... I've since tweaked the name of that sublink, heres the new one:
http://publiclab.org/wiki/infragram-webapp-dev#Installing+into+Local+Virtualenv+Development+Environment

On Sun, May 26, 2013 at 7:43 PM, Craig Versek <cve...@physics.umass.edu> wrote:

Jeffrey Warren

unread,
Jun 4, 2013, 10:25:59 AM6/4/13
to Don Blair, Craig Versek, Chris Fastie, plots-i...@googlegroups.com

Don Blair

unread,
Jun 4, 2013, 12:16:19 PM6/4/13
to Jeffrey Warren, Craig Versek, Chris Fastie, plots-i...@googlegroups.com
Cool!



On Tue, Jun 4, 2013 at 10:25 AM, Jeffrey Warren <je...@publiclab.org> wrote:
Reply all
Reply to author
Forward
0 new messages