Monday, April 22, 2013

Manually Focusing a Logitech Pro 9000 on Ubuntu or Raspbian with Python

The Logitech Pro 9000 is a cute little plug-n-play webcam that will work with Linux systems (in my case, Ubuntu on my Giada and Raspbian on my Raspberry Pi). Below are command line instructions to set it up and use the webcam.

To set it up, open a terminal and simply run from command line:
$sudo apt-get install fswebcam

Then, you should search to see where the camera hardware is: 
$ls /dev

Once you find where your device is, you can now call your camera from the proper directory to capture and save an image with (NOTE: every time you run this code, you write over the same jpg file): 
$fswebcam -d /dev/video0 "image.jpg"

To be safe, check to see if your image was saved with: 
$ls

If you are unable to click and open your image to view it, I have been using the default Eye of Gnome image viewer: 
$eog image.jpg


In my efforts to test the Logitech webcam for my engineering design project, I ran into the issue of getting my webcam to focus at short focal lengths. My test subject placed inches away from the camera lens was super blurry but things at infinite distance were focused. Took me some time, but I finally figured out how to control the focus of the webcam. 

If you have been Googling "Logitech Pro 9000 Linux Focus" or anything like that, don't even bother trying to follow any tutorials that direct you to the QuickCamTeam website. It's shut down and you can't get their logitech.xml file. Fuck it. 

Download the Video4Linux Utilities library with: 
$sudo apt-get install v4l-utils

With Video4Linux, you will be able to manually control your webcam. I needed to turn off the auto focus on mine and set it to a fixed focus length. So where should you start?

To see a list of all the common options:
$v4l2-ctl --help

To see a list of things you can control on the webcam:
$v4l2-ctl --list-ctrls

To alter your webcam controls, your command should look like:
$v4l2-ctl --set-ctrl=<ctrl>=<value>

I needed to play around with my camera's ability to focus. To set it to autofocus, I used:
$v4l2-ctl --set-ctrl=focus=0

But that's not what I need my camera to do for my project since the device will be at a set distance from its subject. So, I can use any value from 0 to 255 to set my focus. I used a value of 200, which makes my camera focus clearly on objects 2 inches away.


If you want to call these bash command lines from Python code:
import os
os.system('v4l2-ctl --set-ctrl=<ctrl>=<value>')
os.system('fswebcam -d /dev/video0 image.jpg')


If you have SimpleCV installed and would like to display your camera for more adjusting purposes:
import os
from SimpleCV import *
os.system('v4l2-ctl --set-ctrl=<ctrl>=<value>')
cam = Camera()
disp = Display()
while disp.isNotDone()
  img = cam.getImage()
  img.save(disp)

Monday, April 8, 2013

New Favorite Snack

Bought two packs of 99cents strawberries at the Grocery Outlet today. I put one box in the freezer. Was looking for a snack and decided to chop up some strawberries from the fridge and mix them with honey nut Cheerios in low-fat vanilla yogurt. Found my new favorite healthy snack. 

Changing my diet to help me lose weight/slim down/ tone that ass will be fun. 

Tuesday, April 2, 2013

Sevendust, Coal Chamber, and Lacuna Coil Concert

For my partner's birthday, I bought tickets for us to go see a Sevendust, Coal Chamber, and Lacuna Coil concert. It had been a long time since I saw a metal concert. So, I decided now or never. We arrived right on time; however, because I forgot my ID, I wasn't able to hit up the venue bars. Boo. But that was fine since I drove. Anyway, here are some pictures and videos that I was able to take/record. Qualities are not great, but that's fine for me. The experience is what matters, and the concert was fucking great. Lacuna Coil's female singer stole my heart and my love of Coal Chamber was resurrected. Coal Chamber is soooo good live.



Lacuna Coil

Lacuna Coil - "To the Edge" clip

Coal Chamber 

Coal Chamber - "Loco" clip

 
Coal Chamber - "Big Truck" clip

Coal Chamber - "Fiend"

Coal Chamber - "Drove" clip

More Coal Chamber

Sevendust (had moved to the back)



Howdy Partner Happy Birthday!

Today, April 2nd, is my partner's birthday. So, I ran over to him, interrupted his WoW game, gave him a hug, and screamed, "Yay!!! Guess whose birthday it is?! You came out of your mom's vagina today!"

And all he could do was laugh and say, "Awkward." I'm pretty sure he was probably Skyping with other players. 

Time to make his first day of being 26 hell... I mean one hell of an awesome day.

Friday, March 29, 2013

Cutting Up T's

In light of the Sevendust, Lacuna Coil, and Coal Chamber concert tomorrow, I wanted to mod my DevilDriver shirt. So, I spent the afternoon looking up videos and tutorials on how to cut up T-shirts. Below is a link to a video that I have followed:
http://www.ehow.com/video_12231917_cut-custom-diy-shirt.html

My first test was on a T-shirt from my partner's father. I don't wear it much, but now that I have cut it up and modded it, I think I will. On a warm day like today, it sure does keep my back nice and cool. Say goodbye to nasty back sweat!





BONUS: I kept the bottom part of the shirt that I cut off as a matching headband for the day. If I had a cute white flower, I could glue or pin it to the headband.

Lesson of the Day: If you don't fit your clothes, make your clothes fit you!


Tiny Steps


I am becoming more self-conscious of my figure. I am not overweight. I just miss being at the peak of my physical fitness. And I really would like to have a more appealing bod by vacation in July. Haven't been as active as I used to be. So, I am taking tiny steps to being healthier and taking care of my body. 

This morning, I went on a short walk/jog with the dog. I followed this with a nice cool shower, strawberries, Vietnamese espresso, and a breakfast sandwich that consisted of a veggie patty, cheese, ketchup, Sriracha, cucumbers, sauteed onions, lettuce, and a scrambled egg. 

And yes, those are funfetti cupcakes behind my meal made by my partner. No, I did not eat one this morning, but I did take a bite out of the top of one of them and place it back on the plate. Har har har.

Revamping this Blog

It's been a long time since I have blogged. I used to do it daily many years ago, and I loved it. I tried reading through an older blog of mine; however, it was really hard to get through. I have dealt with so much pain. Now is the time for change. I'm tired of recollecting the dark times in life. Time to look forward and embrace the good. Time to revamp this blog and start making good memories that I'd be happy to share.