From charlesreid1

 
(19 intermediate revisions by the same user not shown)
Line 32: Line 32:
* motion server/fwcapture?
* motion server/fwcapture?


==Modification Planz==
==Modifications==


===Original pelican case===
Modifications to the Pelican case are covered at the [[RaspberryPi/Weatherproof Camera Case]] page.


Here is the stock Pelican case (Pelican 1120 Case):
=Pelican Case Modification: Success=


[[Image:StockPelicanCase.jpg|500px]]
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:StockPelicanCaseOpen.jpg|500px]]
[[Image:FinishedPelicanMod2.jpg|500px]]


It's an absolutely perfect size for a Raspberry Pi and power supply.
[[Image:PelicanPacked1.jpg|500px]]


===Modification planz and schematics===
=Upgrading Image Software=


Here is the plan: drill a 1/2" hole in the side of the Pelican case, and mount the camera to the case. Use rubber to ensure a tight fit between the camera and the body. The camera came with a plastic cover, so utilize that as the camera lens protector. (Secure it to the lens better, too.) Most important principle here is KISS. Don't worry about making it perfectly weatherproof. Can add a little rain visor gasket to it later, or swap it out for a different design.
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.


[[Image:PelicanSchematic1.jpg|500px]]
==Installing SimpleCV==


[[Image:PelicanSchematic2.jpg|300px]]
{{Main|SimpleCV}}


As you can see, I follow extremely rigorous engineering standards in my drawings.
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=
=Flags=

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