From charlesreid1

No edit summary
 
(29 intermediate revisions by the same user not shown)
Line 6: Line 6:


[[Image:USBCamera1.jpg|500px]]
[[Image:USBCamera1.jpg|500px]]
This camera is 1/2 inch in diameter.


=Timelapse 4 Plan=
=Timelapse 4 Plan=


Re-use some of the things that were accomplished with [[RaspberryPi/Timelapse3]] (example: we were able to control the LED).  
First, let's start with what we like, and what we've accomplished:
* Several things were accomplished with [[RaspberryPi/Timelapse3]] (example: we were able to control the LED).  
* Can resurrect idea bucket, continue working on the weatherproofing ideas, now that the bottleneck has been removed (better camera)
 
Plan for weatherproof camera mount:
* KISS
* Mount it, use the cap that came with it, put a rubber gasket around it to protect from rain further
* Don't worry about making it bomb-proof your first time. Just get the parts working in sync.
 
==Stuff List==
 
Hardware list:
* raspberry pi 3
* usb jump drive (for photo storage)
* usb camera
 
Software list:
* script to operate camera
* necessary Python bindings for taking photos
* motion server/fwcapture?
 
==Modifications==
 
Modifications to the Pelican case are covered at the [[RaspberryPi/Weatherproof Camera Case]] page.
 
=Pelican Case Modification: Success=
 
Modifications made to the Pelican case, described at [[RaspberryPi/Weatherproof Camera Case]], were successful. The camera lens was about 0.55 inches in diameter, and fits into the hole with very little clearance. I have more notes on the specifics of the case modification over at [[RaspberryPi/Weatherproof Camera Case]]. This is Stage 1 of the Pelican modifications. Eventually this will be full-on waterproof, but the goal for Timelapse 4 was to keep it simple, stupid.
 
[[Image:FinishedPelicanMod2.jpg|500px]]
 
[[Image:PelicanPacked1.jpg|500px]]
 
=Upgrading Image Software=
 
I needed to upgrade the way I was grabbing images from the camera. I decided to bite the bullet and go with SimpleCV, which would provide access to more high-power image processing applications - exactly what I'm looking for.
 
==Installing SimpleCV==
 
{{Main|SimpleCV}}
 
To install SimpleCV on the Raspberry Pi, you will need to install scipy, and that's gonna take a while. Same thing with OpenCV, a library required by SimpleCV.
 
<pre>
$ sudo apt-get install python-scipy
$ sudo apt-get install python-opencv
</pre>
 
(Note: I don't recommend doing <code>pip install scipy</code>, as that does not install the proper linear algebra headers, and now you're going to spend your evening in Dependency Hell.)
 
Now install SimpleCV:
 
<pre>
$ sudo pip install simplecv
</pre>
 
==Using SimpleCV==
 
{{Main|SimpleCV}}
 
Basic usage script for SimpleCV:
 
<pre>
from SimpleCV import Camera
import time
cam = Camera()
time.sleep(3) # wait for the camera to warm up
img = cam.getImage()
img.save("image.png")
</pre>
 
If added to an infinite loop with a time delay, this can be used to make timelapse photos:
 
<pre>
from SimpleCV import Camera
import os
import time
from datetime import datetime
 
cam = Camera()
time.sleep(0.1)
 
lapse_dir = datetime.strftime(datetime.now(),"timelapse_%Y%m%d-%H%M%S")
os.system('mkdir '+lapse_dir)
 
while True:
 
    prefix = datetime.strftime(datetime.now(),"%Y%m%d-%H%M%S")
    filename = lapse_dir+"/"+prefix+".jpg"
 
    img = cam.getImage()
    img.save(filename)
    print "Saving photo to %s"%(filename)
 
    time.sleep(2)
</pre>
 
=Results=
 
Here's a sample image:
 
[[Image:Timelapse4Sample.jpg|500px]]
 
=Flags=


The USB camera will make it easier to resurrect the idea bucket and figure out how to best mount the camera.
{{PiFlag}}


I say, keep it simple, mount it, add the cap on, and a rubber layer around it if you want to protect it from rain.
[[Category:August 2016]]

Latest revision as of 06:48, 19 August 2016

Also see RaspberryPi/USB Camera

Overview

For timelapses 1-3, I had multiple headaches dealing with the weak-sauce ribbon-cable Pi camera. I dumped it for a more hefty, webcam-style USB camera. Photo:

USBCamera1.jpg

This camera is 1/2 inch in diameter.

Timelapse 4 Plan

First, let's start with what we like, and what we've accomplished:

  • Several things were accomplished with RaspberryPi/Timelapse3 (example: we were able to control the LED).
  • Can resurrect idea bucket, continue working on the weatherproofing ideas, now that the bottleneck has been removed (better camera)

Plan for weatherproof camera mount:

  • KISS
  • Mount it, use the cap that came with it, put a rubber gasket around it to protect from rain further
  • Don't worry about making it bomb-proof your first time. Just get the parts working in sync.

Stuff List

Hardware list:

  • raspberry pi 3
  • usb jump drive (for photo storage)
  • usb camera

Software list:

  • script to operate camera
  • necessary Python bindings for taking photos
  • motion server/fwcapture?

Modifications

Modifications to the Pelican case are covered at the RaspberryPi/Weatherproof Camera Case page.

Pelican Case Modification: Success

Modifications made to the Pelican case, described at RaspberryPi/Weatherproof Camera Case, were successful. The camera lens was about 0.55 inches in diameter, and fits into the hole with very little clearance. I have more notes on the specifics of the case modification over at RaspberryPi/Weatherproof Camera Case. This is Stage 1 of the Pelican modifications. Eventually this will be full-on waterproof, but the goal for Timelapse 4 was to keep it simple, stupid.

FinishedPelicanMod2.jpg

PelicanPacked1.jpg

Upgrading Image Software

I needed to upgrade the way I was grabbing images from the camera. I decided to bite the bullet and go with SimpleCV, which would provide access to more high-power image processing applications - exactly what I'm looking for.

Installing SimpleCV

To install SimpleCV on the Raspberry Pi, you will need to install scipy, and that's gonna take a while. Same thing with OpenCV, a library required by SimpleCV.

$ sudo apt-get install python-scipy
$ sudo apt-get install python-opencv

(Note: I don't recommend doing pip install scipy, as that does not install the proper linear algebra headers, and now you're going to spend your evening in Dependency Hell.)

Now install SimpleCV:

$ sudo pip install simplecv

Using SimpleCV

Basic usage script for SimpleCV:

from SimpleCV import Camera
import time
cam = Camera()
time.sleep(3) # wait for the camera to warm up
img = cam.getImage()
img.save("image.png")

If added to an infinite loop with a time delay, this can be used to make timelapse photos:

from SimpleCV import Camera
import os
import time
from datetime import datetime

cam = Camera()
time.sleep(0.1)

lapse_dir = datetime.strftime(datetime.now(),"timelapse_%Y%m%d-%H%M%S")
os.system('mkdir '+lapse_dir)

while True:

    prefix = datetime.strftime(datetime.now(),"%Y%m%d-%H%M%S")
    filename = lapse_dir+"/"+prefix+".jpg"

    img = cam.getImage()
    img.save(filename)
    print "Saving photo to %s"%(filename)

    time.sleep(2)

Results

Here's a sample image:

Timelapse4Sample.jpg

Flags