Pages

Tuesday, June 18, 2013

Test webcam function refactoring notes

Now I am incrementally enhancing the test web cam program.


# *****************************************************************************
# Function - TestWebcam()
# Notes - 
#   * BenQ 737s 17" LCD monitor native Resolution 1280 x 1024
#   * C920 image size = HD1080 (1920 x 1080), HD720 (1280 x 720)
#   * pygame error: No video mode large enough for 1920 x 1080
# *****************************************************************************

Size640x480 = (640, 480)
Size1280x720 = (1280, 720)
Size1280x1024 = (1280, 1024) # ValueError: Destination surface not the correct width or height
Size1920x1080 = (1920, 1080) # pygame.error: No video mode large enough for 1920x1080

def TestWebcamCamera09(cameraNumber, imageSize, imageCount, timerSecond, fileName):

    ftprint.PrintDoubleSpaceLine("*** Sample run begin - TestWebCamCamera08() 2013jun18hkt10:54 ***")    

    pygame.init()
    pygame.camera.init()

    webCamList = pygame.camera.list_cameras()
    webCamCount = len(webCamList)
    print "Number of cameras found = ", webCamCount
    print "Camera used = ", cameraNumber
    print "Image size = (", imageSize[0], ", ", imageSize[1], ")"
    print "Number of images to get = ", imageCount
    print "Time between images (in seconds) = ", timerSecond

    imageSize = Size1280x720 # debug only !!!

    webCamCamera = pygame.camera.Camera(webCamList[int(cameraNumber)], imageSize)
    webCamCamera.start()

    pygame.display.init()
    webCamDisplay = pygame.display.set_mode(imageSize, 0)

    webCamSurface = pygame.surface.Surface(imageSize, 0, webCamDisplay)   

    for count in range(imageCount):

        for event in pygame.event.get(): # Escape key from local keyboard, NOT PuTTY!!!
   if (event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE)):                                  
                webCamCamera.stop()
                pygame.quit()
return

   if (event.type == KEYDOWN and event.key == K_x):                                  
                webCamCamera.stop()
                pygame.quit()
return

   if (event.type == KEYDOWN and event.key == K_s):  
       fullPathFileName = os.path.join('/home/pi/fongtoy/', fileName)
                pygame.image.save(webCamSurface, fullPathFileName)
print "Image saved"          

if webCamCamera.query_image(): 
            webCamSurface = webCamCamera.get_image(webCamSurface)
            webCamDisplay.blit(webCamSurface, (0,0))
            pygame.display.flip()

        time.sleep(timerSecond)
print "Image number = ", count

    pygame.image.save(webCamSurface, "/home/pi/fongtoy/testImage.bmp")

    print "File name of last image = /home/pi/fongtoy/testImage.bmp", 

    ftprint.PrintDoubleSpaceLine("*** Sample run end ***")

# *** sampel call *
# ftwebcam.TestWebcamCamera09(cameraNumber = 1, imageSize = (1280, 720), imageCount = 10, timerSecond = 1, fileName = "file20130618hkt1725.bmp")

.END

Testing Logitech C270 and C920 video VGA, HD720, and HD1080 mode

Now I have used TestWebCamera08() to test C270 and C920 VGA, HD720, and HD1080 resolution.  I found pygame cannot do HD1080.  So I have to settle with HD720.

# *****************************************************************************
# Function - TestWebcam()
# Notes - 
#   * BenQ 737s 17" LCD monitor native Resolution 1280 x 1024
#   * C920 image size = HD1080 (1920 x 1080), HD720 (1280 x 720)
#   * pygame error: No video mode large enough for 1920 x 1080
# *****************************************************************************

Size640x480 = (640, 480)
Size1280x720 = (1280, 720)
Size1280x1024 = (1280, 1024) # ValueError: Destination surface not the correct width or height
Size1920x1080 = (1920, 1080) # pygame.error: No video mode large enough for 1920x1080

def TestWebcamCamera08(cameraNumber, imageSize, imageCount, timerSecond):

    ftprint.PrintDoubleSpaceLine("*** Sample run begin - TestWebCamCamera08() 2013jun18hkt10:54 ***")    

    pygame.init()
    pygame.camera.init()

    webCamList = pygame.camera.list_cameras()
    webCamCount = len(webCamList)
    print "Number of cameras found = ", webCamCount
    print "Camera used = ", cameraNumber
    print "Image size = (", imageSize[0], ", ", imageSize[1], ")"
    print "Number of images to get = ", imageCount
    print "Time between images (in seconds) = ", timerSecond

    imageSize = Size1280x720 # debug only !!!

    webCamCamera = pygame.camera.Camera(webCamList[int(cameraNumber)], imageSize)
    webCamCamera.start()

    pygame.display.init()
    webCamDisplay = pygame.display.set_mode(imageSize, 0)

    webCamSurface = pygame.surface.Surface(imageSize, 0, webCamDisplay)   

    for count in range(imageCount):

        for event in pygame.event.get(): # Escape key from local keyboard, NOT PuTTY!!!
   if (event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE)):                                  
                webCamCamera.stop()
                pygame.quit()
return
        
if webCamCamera.query_image(): 
            webCamSurface = webCamCamera.get_image(webCamSurface)
            webCamDisplay.blit(webCamSurface, (0,0))
            pygame.display.flip()

        time.sleep(timerSecond)
print "Image number = ", count

    pygame.image.save(webCamSurface, "/home/pi/fongtoy/testImage.bmp")

    print "File name of last image = /home/pi/fongtoy/testImage.bmp", 

    ftprint.PrintDoubleSpaceLine("*** Sample run end ***")

# *** Sample call ***

# ftwebcam.TestWebcamCamera08(cameraNumber = 0, imageSize = (640, 480), imageCount = 10, timerSecond = 1)
# ftwebcam.TestWebcamCamera08(cameraNumber = 1, imageSize = (640, 480), imageCount = 10, timerSecond = 1)
# ftwebcam.TestWebcamCamera08(cameraNumber = 0, imageSize = (1280, 720), imageCount = 10, timerSecond = 1)
# ftwebcam.TestWebcamCamera08(cameraNumber = 1, imageSize = (1280, 720), imageCount = 10, timerSecond = 1)

# ** Sample output ***

# pi@raspberrypi ~/fongtoy $ sudo python fongtoy.py
# *** Start Program - FongToy v1.12 tlfong01 2013jun18 ***
# *** Sample run begin - TestWebCamCamera08() 2013jun18hkt10:54 ***
# ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
# Number of cameras found =  2
# Camera used =  1
# Image size = ( 1280 ,  720 )
# Number of images to get =  10
# Time between images (in seconds) =  1
# Image number =  0
# Image number =  1
# Image number =  2
# Image number =  3
# Image number =  4
# Image number =  5
# Image number =  6
# Image number =  7
# Image number =  8
# Image number =  9
# File name of last image = /home/pi/fongtoy/testImage.bmp
# *** Sample run end ***
# *** Stop Program ***
# pi@raspberrypi ~/fongtoy $ date
# Tue Jun 18 05:27:42 UTC 2013

.END

4:3 or 16:9 aspect ratio webcam and monitor selection notes

My old camera Sony Cybershot DSC-S90 and PC monitor Phillips 190B are 4:3 aspect ratio.  However my new webcam Logitech C920 is 16:9 (HD702 and HD1024).  I was wondering if I should upgrade to 16:9 sooner or later.  So I googed to know more.  After reading the following article, I decided not to upgrade either my 7 year old camera or 5 year old monitor.


4:3 vs 16:9 ASPECT RATIO WHICH MONITORS ARE BEST? - tru-vumonitors

http://www.tru-vumonitors.com/articlesreference/43vs169aspectratio.html

Which is better:  4:3 or 16:9 format LCD screens?  As is often the case, the answer is "That depends..."

There's no doubt that today's HD televisions look fantastic.  However, are 16:9 aspect ratio monitors really the best choice for your industrial/commercial project?

WHAT IS ASPECT RATIO?

Aspect ratio is the relationship of the width of a video image compared to its height.  The two most common aspect ratios are 4:3, also known as 1.33:1 or fullscreen, and 16:9, also known as 1.78:1 or widescreen.  (Larger aspect ratio formats are used in the motion picture industry.)

All the older TV's and computer monitors you grew up with had the squarish 4:3 shape--33% wider than it was high.  4:3 LCD monitors can display analog video signals that conform to NTSC and PAL standards.  They are not capable of displaying HD (high-definition) video.

The 4:3 aspect ratio dates back to 1917, when the Society of Motion Picture Engineers adopted it as the standard format for film.  In the 1930's, the television industry adopted the same 4:3 standard.  But in the mid-1950's, the motion picture industry began developing several widescreen formats to improve their decreasing audience numbers.  Television broadcasting stayed with the 4:3 standard, until the recent move to HDTV and 16:9 widescreens.

16:9 is the native aspect ratio of most high-definition LCD monitors and TV's (15:9 and 16:10 are very similar).  It is 78% wider than it is tall, and fully one-third wider than a 4:3 screen.  16:9 widescreen monitors are ideally suited to display HD video signals.  Some models can also display SD (standard definition) video signals, but this will require some compromises as you will read below.

DO THEY MATCH?

Nearly all experts agree that in order to display optimal video images, it is critical to match the aspect ratio of the monitor to the aspect ratio of the camera (or other incoming video source).  Below is an example of a 16:9 image on a 16:9 monitor:

...

However, the majority of cameras in the industrial, commercial, security and law enforcement industries still utilize 4:3 CCD or CMOS imagers.  Therefore, to display clear, undistorted video images, it is important to utilize monitors with the same 4:3 aspect ratio to match the cameras.  Failure to do so will result in distorted images, as shown below.

There are 3 primary ways to display a 4:3 video signal on a 16:9 monitor, each with its own drawback:

1.  Tolerate vertical black bars on the left and right sides of the screen (called
    "pillarboxing"):

2.  Have horizontally stretched and distorted images, making people and objects
    appear shorter and wider:

3.  Or zoom-in the video signal, which chops off the top and bottom portion
    of the images:

Unfortunately, despite the continued widespread use of 4:3 cameras, LCD monitors with a 4:3 aspect ratio are getting harder and harder to find, as many manufacturers have transitioned to the newer 16:9 widescreens.  TRU-Vu Monitors still offers a complete line of industrial-grade 4:3 aspect ratio LCD monitors.  These range in size from 3.5" to 20" screens, in standard, touch screen, rack mount, sunlight readable, medical-grade, optically bonded and open frame LCD monitor configurations.  See www.TRU-VuMonitors.com for more details.

16:9 widescreen LCD monitors are the ideal complement to 16:9 format HD cameras, increasingly used in video conferencing, broadcast and medical applications.  They display superb, distortion-free, high-definition images.  TRU-Vu Monitors offers these in 21.5" to 46" LCD screen sizes, in standard, touch screen, sunlight readable, medical-grade, optically bonded and open frame configurations.

In conclusion, in order to avoid video images which are stretched, chopped, squeezed, shrunk or distorted, be sure to choose a LCD monitor with an aspect ratio (4:3 or 16:9) that matches your camera or other incoming video signal.

FREE NEWSLETTER

Do you wish to receive information about  New LCD Monitors, New Display Technology  and Our Special Promotions?

Then subscribe to our FREE  TRU-Vu Monitors Email Newsletter!

http://www.tru-vumonitors.com/freenewsletter.html

.END

Monday, June 17, 2013

Logitech Webcam C920 HD720 autofocus at 10cm performance good




Now I am checking out how C920 autofocuses in HD720 at 10cm close up.  I found it good.  My 17" BenQ LCD mon has a native resolution of 1280 x 1024, so the HD720 of 1280 x 720 does no fill up full screen.

C920 can shoot at 1920 x 1280, but my 19" Philips 190B can display only 1280 x 1024.  So it is difficult for me to test HD1024.  I would stop at HD720, which is already good for me.

.END













Logitech C920 autofocus performance test





























Now I am testing C920 autofocus performance at 10cm close up, vga 640 x 480 resolution.   C920 indeed autofocus better than C270.  But I am not sure if it is also because of C920's better lens and higher resolution.

.END




Logitech Webcam C920 vs C270

I found the HK$169 Logitech C920 OK, at least for VG! 640 x 480 resolution.  Now I am going to check out tje HK$699C920.


Logitech HD Pro Webcam C920  Logitech Autofocus. The clear choice for clear video.

http://www.logitech.com/en-us/product/hd-pro-webcam-c920

Bye bye, blur

A lot of webcams out there want you to stay put. Move or get too close and the camera can have a tough time automatically focusing on you—even if it’s got a good lens. That can leave you looking hazy and out of focus. And that’s probably not the look you’re going for.

At Logitech, we don’t want your video to become a blur. So we created an autofocus system that lets you move around. It zeroes in on whatever’s in the center of the frame, like your face. When you move, the webcam automatically tracks your motion and refocuses the image. You’ll be crystal clear in less than three seconds

Ready for your close-up

Want to zoom in for a kiss? Or hold something up to the camera? Our autofocus system can handle it. It focuses in and out automatically with precision and speed—even if the item is only 10 cm from the camera. No choppiness. No blur. Just a clear, sharp image.
How’d we do that?

We used the same type of motor used in mobile-phone cameras, a voice coil motor (VCM), and optimized it for webcams. They’re compact, don’t use a lot of battery power, and can handle shock and vibration. The lens moves back and forth to adjust focus until the webcam gives you the sharpest image possible. It also helps stabilize the webcam so your video and photos are in focus and have low distortion. So, you can go ahead and make your move.


See all webcams with autofocus.

HD Pro Webcam C920USD 99.99
HD 1080p
Carl Zeiss Optics
H.264 hardware compression technology

Improving image quality for the HD Pro Webcam C920

How can I improve the image quality for my webcam?

HD Pro Webcam C920
Model Number:
V-U0028 (Webcam)

To get better quality images using Logitech Webcam Software (LWS):

Connect your camera directly to a USB port or your computer — don't use a hub or docking station.

Make sure your USB 2.0 port is working at a high speed. See answer 3139 for help.

Check that your system meets the recommended Dual Core CPU requirements.

Avoid multi-tasking while capturing video, as this requires a lot of CPU usage.

Get the latest driver for your camera.

Improve the lighting conditions in the room.

To get better image quality when chatting over an IM application such as AIM, Skype, Vid, Yahoo! or WLM:

Make sure you've met all of the requirements listed above.

Check your internet connection speed (http://www.speakeasy.net/speedtest). You need at least 384kps for uploading and one megabit for downloading.

NOTE: Your internet speed may not be what your internet provider says it is, or you may be using the internet during a period of heavy traffic.

Try using a different IM application — it may provide better results.

Consider that the image quality problem could be with the sender's computer rather than your own.

NOTE: If you don't own a high-speed or USB 2.0 camera, your image quality may never be as good as a camera with USB 2.0 capabilities.

System Requirements

Windows Vista®, Windows® 7 (32-bit or 64-bit) or Windows® 8

For HD 1080p video recording:

2.4 GHz Intel® Core 2 Duo processor

2 GB RAM or more

Hard drive space for recorded videos

USB 2.0 port (USB 3.0 ready)


Recommended requirements for full HD 1080p and 720p video calling*:

1 Mbps upload/download for 720p

2 Mbps upload/download for 1080p

(Requirements for H.264 and MJPEG formats vary)

Visit your preferred video calling provider’s website for exact information on system and performance requirements.

For Skype® in Full HD 1080p

Skype 5.8 for Windows*


Technical Specifications

Full HD 1080p video calling (up to 1920 x 1080 pixels) with the latest version of Skype for Windows*

720p HD video calling (up to 1280 x 720 pixels) with supported clients

Full HD video recording (up to 1920 x 1080 pixels) with a recommended system**

Logitech Fluid Crystal™ Technology

H.264 video compression*

Carl Zeiss® lens with 20-step autofocus

Built-in dual stereo mics with automatic noise reduction

Automatic low-light correction

Hi-Speed USB 2.0 certified (USB 3.0 ready)

Tripod-ready universal clip fits laptops, LCD or CRT monitors

Logitech webcam software:***

Video recording: Up to Full HD 1080p video capture**

Photo capture: Up to 15 megapixels (software enhanced)

1-click Facebook®, Twitter™ and YouTube™ HD upload (registration required)

*Please download the latest version of Skype, Skype 5.7 Beta for Windows, which offers 1080p HD video calling.

** H.264 recording requires installation of QuickTime®.

*** Requires installation of included software.

Write your own review

Arun from Philadelphia, PA
EXPERTISE: Tech Savvy
FEATURED REVIEW
THE MOST AMAZING CAMERA FOR VIDEO CALLING
January 22, 2012
I have this camera for three days now and can't believe, the quality is more than expected definitely and A++++++.
The face tracking technology lets me move here and there & it follows and makes it more fun, lively & realistic than --just sitting and chatting.
Installtion was easy on my windows 7 PC & have to be honest; its a little complex on the installation & functionality on the Macbook pro notebook. Finally it had it functional on mac but the zooming and face tracking would not work.
With 1080p calling on skype or Logitech Vid HD, it just has made the world a little bit smaller again!! :)
Photo/video quaility is crisp, clean, and very detailed!!
One can somehow feel the H.264 encoding as lines in the backgroud occasionally with more high quality movements in frames capturing the face.
A little overpriced and thus would wait for the price to go down in a month or two to get it again for my relatives and friends who prefer vidoe-chatting with me!
If you dont have a PC camera and looking for the finest in the market- close your eyes and go for it!
helpful121unhelpful33
Report inappropriate content


Disappointed
TERRIBLE COMPRESSION
May 7, 2013
The hardware compression on this camera is simply awful and there's no way to adjust it. For a Skype call, it is passable but if I want to record videos at my desk, it's pretty awful. My iPhone 3gs can record better video. Also, microphone sensitivity is really poor. You have to be right up close to the camera to get clear audio. Disappointed.
helpful6unhelpful6
Report inappropriate content


SCCFOPANG from Los Angeles, CA, USA
AGE: 25 to 34
GENDER: Male
LENGTH OF USE: One Month to a Year
DOES NOT WORK.
April 11, 2013
I bought this WEBCAM C920 on Amazon.It only took Four months will not be able to use.It's too bad quality.
helpful3unhelpful20
Report inappropriate content


TBLtech from Edmonton, AB, Canada
AGE: 35 to 44
GENDER: Male
LENGTH OF USE: One Month to a Year
WORKS GREAT FOR OUR LOW COST WEBINAR MINI-STUDIO
February 14, 2013
We have been using the Logitech C905 and the MS Lifecam Studio for over a year to do webinars. A few months ago we purchased the c920 for another purpose and I decided to test it out in our mini-studio which has softbox lighting and soundproofing. What a difference in quality and CPU usage. The Logitech video effects work better on this camera than the c905 probably due to higher resolution capture. The software installs very easily and we mounted it on a tripod. I use the mirror image switch in the software so the presenters don't get confused when seeing themselves in the webinar. Great product, I recommend it to other colleagues who ask me for tips. It is now our primary camera. I can't comment on low lighting capture since we have the room bathed in proper lighting.
helpful15unhelpful4

DOES NOT WORK
October 29, 2012
Read the recommendations online and wished to use it for Skype on my TV. Did not work with my Panasonic BDT320 using the USB cable so took it back and was informed to feed through my plasma TV. This also did not work as it requires an HDMI cable. After some effort managed to get a signal through my PC but the software was non-user friendly and the images nothing to rave about. I recomend you buy a standard webcam for $30 if you are using it for a PC only. If like me you were hoping to take advantage of HD for your home theater wait till they sort the bugs out and make it compatable with more devices before you fork out for this.
helpful24unhelpful129
Report inappropriate content


MadDog1950 from Dixon, Illinois
EXPERTISE: Proficient User
EXCELLENT CAMERA
October 10, 2012
Now that I have owned the HD Pro Webcam C920 for several weeks I stand corrected. This is an excellent camera And the special effects do work well during video chats. The C920 does operate well in normal light however I’m still disappointed with is its low light capabilities. I would recommend this camera to other folks.
helpful18unhelpful4
Report inappropriate content


MadDog1950 from Dixon, IL
EXPERTISE: Tech Savvy
EXCELLENT WEB CAMERA BUT HAS PROBLEM
September 19, 2012
I just installed the HD Pro Webcam C920 and I'm not pleased with it's preformance in Low Light Environments. I my opinion it is no better than the 9600 Camera. The advertisements are very misleading.
In addition Logitec's Video Effects will not work on this camera - a fact that IS NOT told to the consumer up front in the advertisements.
However the picture quality is good, However it is not as clear as the Logitec 9600. The image needs to be sharpened.
helpful18unhelpful7
Report inappropriate content

PCDOC
THIS IS THE BEST!
August 17, 2012
I tried other web cams i bought cheap plastic i also bought the compitions Web cam and maybe the other cam has more video effects this cam is by far superior I use this in my every day life as a paid performer and i never had a problem with HD quality i get compliments all the time on my cam feed it's the best for this price group and you just need it for Msg service? then wow! you got a nice web cam experience and this cam bar none is great can't wait to see what is next guy's? Remote control please? and the sound is great thanks a million haha

BEST CAMERA EVER!
August 10, 2012
Great camera! Lots of cool features! Great video AND audio quality! Easy to install! I love it!!!
helpful6unhelpful3
Report inappropriate content


End User from St. Louis, MO
EXPERTISE: Tech Savvy
OKAY
August 4, 2012
The picture quality is good but you cannot mirror image which is confusing when you are watching yourself...the soom feature on the control barely zooms at all which means if you want to show womething up close you have to walk to the camera...the cortol page is limited...and you cannot get the picture window to enlarge because there is no full screem option. For the money you think they would make a better product with regards to the end users needs.
helpful15unhelpful16

terible from arizona
EXPERTISE: Proficient User
NEEDS BETTER ZOOM
July 29, 2012
I was suprised when I zoomed in the first time, it would only go about 15% bigger than normal size. Had a hard time gettin the right drivers since it came with no disc like my other cams did.

Dude from San Antonio, Tx.
EXPERTISE: Tech Savvy
COOL CAM
May 30, 2012
The resolution on this camera is superb. I tried three of them on three separate settings and it works flawlessly in any light condition even in dark rooms with only a projector as a light source.
Installation was a snap using Windows 7.

I recommend this camera to anyone who is looking for professional quality.

I did not test the Audio, Since I have all omnidirectional professional quality microphones I use to capture audio. I would recommend you would invest in a high quality microphone if you are to broadcast in a classroom or conference setting.
I do not work for the company, I am an independent Audio Visual technician and IT person and just wanted to share my experience utilizing this hardware.

WASTE OF TIME ON WIN7 64BIT HP DC7900 SYSTEM
May 2, 2012
Have tried two cameras on three different HP dc7900 SFF PCs. All Behave the same - With Camera plugged in PC will not POST. Yes, I updated BIOS to disable Boot from USB. Currently this has been elevated to Tier2.
I have tried the c910 - works great, that is why I tried the c920. May be time to downgrade or switch to another vendor.

WhoEver
EXPERTISE: Tech Savvy
I HATE THE SOFTWARE
April 15, 2012
The software from Logitech for this device is NOT user friendly.
First of all it is NOT set up for users with dual monitors. It switches back to the main monitor when I cahnge a setting then I have to bring it back to the monitor I WANT IT TO DISPLAY ON. I really get frustrated when software is NOT able to do what I want it to do. When I set it to display on a monitor I know what I am doing and I set it on that monitor for a reason. Like I can actualy see if on that screen. What a thought, a user who knows what they are doing.
Another screen issue but the software will not maximize and so when used on a tower system with a 32 inch MONITOR behind me and a 45 inch TV in front, from across the room it is really hard to see and make changes to the controls.
I guess it is good for a laptop but I wan to use it on my media system.
Many times without any apparent reason, when recording the software will count down and then not record. This is actually more of an issue with using a high quality USB mic so I am forced to use the built in one which is good but not as good as the one I want to use.
So far I have not had much time actually using the camera because each time i try to tweek it I run into issues.
I will try to find better software than the low end stuff Logitech distributes and hope my experiance is better. I normally am quite pelased with Logitech, I wish that were true with this as well.

baldy6
TERRIBLE AUDIO, AVERAGE PICTURE
March 28, 2012
I had high expectations but poor results. I wanted to use the device for recording myself playing the guitar. The audio was garbled and distorted when playing music. Speech was flat and unnatural sounding. I am returning it immediately.


Jersey Mike from Toms River, NJ
EXPERTISE: Tech Savvy
ABSOLUTELY THE BEST WEBCAM EVER
January 26, 2012
This truely is the BEST webcam I've ever used and between you and me, Logitech outdid themselves here. It's like Logitech was already #1 in webcams but now after this, there is literally and flat out no way that any other manufacturer will ever come close. I look forward to videochatting with people and actually perfer it to the real thing. The only thing Logitech needs to work on is increasing the audio sample rate and bit depth from 2 channel, 16 bit, 32000 Hz (FM Radio Quality) to 2 channel, 24 bit, especially if users want to use this camera on Skype (and othe rprograms) which support WideBand.

.END


Logitech HD Webcam C270

Technical Specifications

The specs:

HD video calling (1280 x 720 pixels) with recommended system

Video capture: Up to 1280 x 720 pixels

Logitech Fluid Crystal™ Technology

Photos: Up to 3.0 megapixels (software enhanced)

Built-in mic with noise reduction

Hi-Speed USB 2.0 certified (recommended)

Universal clip fits laptops, LCD or CRT monitors

Logitech webcam software:

Pan, tilt, and zoom controls

Video and photo capture

Face tracking

Motion detection

.END

Logitech C270 and Sony DSC S90 auto focus performance at close up distance of 10cm

































Now I am testing C270's auto focus performance at close up distance of about 10cm.  The picture is not very sharp, but I think it is more or less OK for toy projects in computer vision.

.END


Webcam lighting adjustment notes































Now I am experimenting with various lighting positions to get a feeling of the appropriate lighting direction and intensity for a good quality picture.  I found it difficult to adjust to get a good picture. especially when the object surface is reflective, like the protoboard with shiny soldering pads.  I am thinking of adding adjustment of power supply voltage to change the light intensity.  I suspect that the camera got confused and doesn't know how to do auto focus, resulting in this fuzzy picture.

.END

Low frequency video signal interference of 200V AC powered LED lamps

































So far I have been using 200VAC input LED lamps for web cam photography.  But there are 2 problems.  First, rectangular shaped lamp shade is a bit bulky.  Second it is not possible to adjust the light intensity.

So I am now experimenting with 12V DC 7.5W LED lamps.  There is small, and intensity can be adjusted by changing the input voltage.

I found one more advantage of the DC powered LED lamp compared to the AC powered.  That is there is no low frequency interference, so there are no horizontal dark band sweeping across the screen.

So I am removing the AC powered LED lamps and won't be using them for a long while.

.END


pygame.key module learning notes

I read the reference of the pygame.key module and found that the control code of Escape is indeed what is received at the RPi side, though not very sure, the ^[.  I thought perhaps I could press ^, then [, but it does not work either.  So I gave up for now.

I am thinking of playing with the key codes later.

.END



pygame.key - pygame module to work with the keyboard

http://www.pygame.org/docs/ref/key.html

pygame.key.get_focused — true if the display is receiving keyboard input from the system
pygame.key.get_pressed — get the state of all keyboard buttons
pygame.key.get_mods — determine which modifier keys are being held
pygame.key.set_mods — temporarily set which modifier keys are pressed
pygame.key.set_repeat — control how held keys are repeated
pygame.key.get_repeat — see how held keys are repeated
pygame.key.name — get the name of a key identifier
This module contains functions for dealing with the keyboard.

The event queue gets pygame.KEYDOWN and pygame.KEYUP events when the keyboard buttons are pressed and released. Both events have a key attribute that is a integer id representing every key on the keyboard.

The pygame.KEYDOWN event has an additional attributes unicode, and scancode. unicode represents a single character string that is the fully translated character entered. This takes into account the shift and composition keys. scancode represents the platform specific key code. This could be different from keyboard to keyboard, but is useful for key selection of weird keys like the multimedia keys.

There are many keyboard constants, they are used to represent keys on the keyboard. The following is a list of all keyboard constants

KeyASCII      ASCII   Common Name
K_BACKSPACE   \b      backspace
K_TAB         \t      tab
K_CLEAR               clear
K_RETURN      \r      return
K_PAUSE               pause
K_ESCAPE      ^[      escape
K_SPACE               space
K_EXCLAIM     !       exclaim
K_QUOTEDBL    "       quotedbl
K_HASH        #       hash
K_DOLLAR      $       dollar
K_AMPERSAND   &       ampersand
K_QUOTE               quote
K_LEFTPAREN   (       left parenthesis
K_RIGHTPAREN  )       right parenthesis
K_ASTERISK    *       asterisk
K_PLUS        +       plus sign
K_COMMA       ,       comma
K_MINUS       -       minus sign
K_PERIOD      .       period
K_SLASH       /       forward slash
K_0           0       0
K_1           1       1
K_2           2       2
K_3           3       3
K_4           4       4
K_5           5       5
K_6           6       6
K_7           7       7
K_8           8       8
K_9           9       9
K_COLON       :       colon
K_SEMICOLON   ;       semicolon
K_LESS        <       less-than sign
K_EQUALS      =       equals sign
K_GREATER     >       greater-than sign
K_QUESTION    ?       question mark
K_AT          @       at
K_LEFTBRACKET [       left bracket
K_BACKSLASH   \       backslash
K_RIGHTBRACKET ]      right bracket
K_CARET       ^       caret
K_UNDERSCORE  _       underscore
K_BACKQUOTE   `       grave
K_a           a       a
K_b           b       b
K_c           c       c
K_d           d       d
K_e           e       e
K_f           f       f
K_g           g       g
K_h           h       h
K_i           i       i
K_j           j       j
K_k           k       k
K_l           l       l
K_m           m       m
K_n           n       n
K_o           o       o
K_p           p       p
K_q           q       q
K_r           r       r
K_s           s       s
K_t           t       t
K_u           u       u
K_v           v       v
K_w           w       w
K_x           x       x
K_y           y       y
K_z           z       z
K_DELETE              delete
K_KP0                 keypad 0
K_KP1                 keypad 1
K_KP2                 keypad 2
K_KP3                 keypad 3
K_KP4                 keypad 4
K_KP5                 keypad 5
K_KP6                 keypad 6
K_KP7                 keypad 7
K_KP8                 keypad 8
K_KP9                 keypad 9
K_KP_PERIOD   .       keypad period
K_KP_DIVIDE   /       keypad divide
K_KP_MULTIPLY *       keypad multiply
K_KP_MINUS    -       keypad minus
K_KP_PLUS     +       keypad plus
K_KP_ENTER    \r      keypad enter
K_KP_EQUALS   =       keypad equals
K_UP                  up arrow
K_DOWN                down arrow
K_RIGHT               right arrow
K_LEFT                left arrow
K_INSERT              insert
K_HOME                home
K_END                 end
K_PAGEUP              page up
K_PAGEDOWN            page down
K_F1                  F1
K_F2                  F2
K_F3                  F3
K_F4                  F4
K_F5                  F5
K_F6                  F6
K_F7                  F7
K_F8                  F8
K_F9                  F9
K_F10                 F10
K_F11                 F11
K_F12                 F12
K_F13                 F13
K_F14                 F14
K_F15                 F15
K_NUMLOCK             numlock
K_CAPSLOCK            capslock
K_SCROLLOCK           scrollock
K_RSHIFT              right shift
K_LSHIFT              left shift
K_RCTRL               right ctrl
K_LCTRL               left ctrl
K_RALT                right alt
K_LALT                left alt
K_RMETA               right meta
K_LMETA               left meta
K_LSUPER              left windows key
K_RSUPER              right windows key
K_MODE                mode shift
K_HELP                help
K_PRINT               print screen
K_SYSREQ              sysrq
K_BREAK               break
K_MENU                menu
K_POWER               power
K_EURO                euro

The keyboard also has a list of modifier states that can be assembled bit bitwise ORing them together.

KMOD_NONE, KMOD_LSHIFT, KMOD_RSHIFT, KMOD_SHIFT, KMOD_CAPS,
KMOD_LCTRL, KMOD_RCTRL, KMOD_CTRL, KMOD_LALT, KMOD_RALT,
KMOD_ALT, KMOD_LMETA, KMOD_RMETA, KMOD_META, KMOD_NUM, KMOD_MODE

pygame.key.get_focused()
true if the display is receiving keyboard input from the system
get_focused() -> bool
This is true when the display window has keyboard focus from the system. If the display needs to ensure it does not lose keyboard focus, it can use pygame.event.set_grab() to grab all input.


pygame.key.get_pressed()
get the state of all keyboard buttons
get_pressed() -> bools
Returns a sequence of boolean values representing the state of every key on the keyboard. Use the key constant values to index the array. A True value means the that button is pressed.

Getting the list of pushed buttons with this function is not the proper way to handle text entry from the user. You have no way to know the order of keys pressed, and rapidly pushed keys can be completely unnoticed between two calls to pygame.key.get_pressed(). There is also no way to translate these pushed keys into a fully translated character value. See the pygame.KEYDOWN events on the event queue for this functionality.


pygame.key.get_mods()
determine which modifier keys are being held
get_mods() -> int
Returns a single integer representing a bitmask of all the modifier keys being held. Using bitwise operators you can test if specific shift keys are pressed, the state of the capslock button, and more.


pygame.key.set_mods()
temporarily set which modifier keys are pressed
set_mods(int) -> None
Create a bitmask of the modifier constants you want to impose on your program.


pygame.key.set_repeat()
control how held keys are repeated
set_repeat() -> None
set_repeat(delay, interval) -> None
When the keyboard repeat is enabled, keys that are held down will generate multiple pygame.KEYDOWN events. The delay is the number of milliseconds before the first repeated pygame.KEYDOWN will be sent. After that another pygame.KEYDOWN will be sent every interval milliseconds. If no arguments are passed the key repeat is disabled.

When pygame is initialized the key repeat is disabled.


pygame.key.get_repeat()
see how held keys are repeated
get_repeat() -> (delay, interval)
When the keyboard repeat is enabled, keys that are held down will generate multiple pygame.KEYDOWN events. The delay is the number of milliseconds before the first repeated pygame.KEYDOWN will be sent. After that another pygame.KEYDOWN will be sent every interval milliseconds.

When pygame is initialized the key repeat is disabled.

New in pygame 1.8.


pygame.key.name()
get the name of a key identifier
name(key) -> string
Get the descriptive name of the button from a keyboard button id constant.



indexnext |previous |Pygame v1.9.2 documentation »


*** key functions ***

for event in pygame.event.get():

if event.type is pygame.QUIT:
            return False

if event.type is pygame.KEYDOWN:
            keyname = pygame.key.name(event.key)

            if event.key == pygame.K_ESCAPE:
                cons.watchkeys['escape'] = 1

if keyname == 'left':
                cons.watchkeys['left'] = 1
            if keyname == 'right':
                cons.watchkeys['right'] = 1
            if keyname == 'up':
                cons.watchkeys['up'] = 1
            if keyname == 'down':
                cons.watchkeys['down'] = 1

            if event.key == pygame.K_w:
                cons.watchkeys['w'] = 1
            if event.key == pygame.K_a:
                cons.watchkeys['a'] = 1
            if event.key == pygame.K_s:
                cons.watchkeys['s'] = 1
            if event.key == pygame.K_d:
                cons.watchkeys['d'] = 1
            if event.key == pygame.K_z:
                cons.watchkeys['z'] = 1
            if event.key == pygame.K_x:
                cons.watchkeys['x'] = 1
            if event.key == pygame.K_SPACE:
                cons.watchkeys['space'] = 1
            if event.key == pygame.K_1:
                cons.watchkeys['1'] = 1
            if event.key == pygame.K_2:
                cons.watchkeys['2'] = 1
            if event.key == pygame.K_3:
                cons.watchkeys['3'] = 1
            if event.key == pygame.K_LALT or event.key == pygame.K_RALT:
                cons.watchkeys['alt'] = 1
            if event.key == pygame.K_RETURN:
                cons.watchkeys['enter'] = 1
            if event.key == pygame.K_TAB:
                cons.watchkeys['tab'] = 1
            if event.key == pygame.K_LSHIFT or event.key == pygame.K_RSHIFT:
                cons.watchkeys['shift'] = 1
            if event.key == pygame.K_LCTRL:
                cons.watchkeys['control'] = 1
            if event.key == pygame.K_F4:
                cons.watchkeys['f4'] = 1
            if event.key == pygame.K_F11:
                cons.watchkeys['f11'] = 1
            if event.key == pygame.K_c:
                cons.watchkeys['c'] = 1
            if event.key == pygame.K_PRINT:
                Tools.screenshotThis()
  
        if event.type is pygame.KEYUP:
            keyname = pygame.key.name(event.key)
            if event.key == pygame.K_ESCAPE:
                cons.watchkeys['escape'] = 0
            if keyname == 'left':
                cons.watchkeys['left'] = 0
            if keyname == 'right':
                cons.watchkeys['right'] = 0
            if keyname == 'up':
                cons.watchkeys['up'] = 0
            if keyname == 'down':
                cons.watchkeys['down'] = 0
            if event.key == pygame.K_w:
                cons.watchkeys['w'] = 0
            if event.key == pygame.K_a:
                cons.watchkeys['a'] = 0
            if event.key == pygame.K_s:
                cons.watchkeys['s'] = 0
            if event.key == pygame.K_d:
                cons.watchkeys['d'] = 0
            if event.key == pygame.K_z:
                cons.watchkeys['z'] = 0
            if event.key == pygame.K_x:
                cons.watchkeys['x'] = 0
            if event.key == pygame.K_SPACE:
                cons.watchkeys['space'] = 0
            if event.key == pygame.K_0:
                cons.watchkeys['0'] = 0
            if event.key == pygame.K_2:
                cons.watchkeys['2'] = 0
            if event.key == pygame.K_3:
                cons.watchkeys['3'] = 0
            if event.key == pygame.K_LALT or event.key == pygame.K_RALT:
                cons.watchkeys['alt'] = 0
            if event.key == pygame.K_RETURN:
                cons.watchkeys['enter'] = 0
            if event.key == pygame.K_TAB:
                cons.watchkeys['tab'] = 0
            if event.key == pygame.K_LSHIFT or event.key == pygame.K_RSHIFT:
                cons.watchkeys['shift'] = 0
            if event.key == pygame.K_LCTRL:
                cons.watchkeys['control'] = 0
            if event.key == pygame.K_F4:
                cons.watchkeys['f4'] = 0
            if event.key == pygame.K_F11:
                cons.watchkeys['f11'] = 0
            if event.key == pygame.K_c:
                cons.watchkeys['c'] = 0

*** Key codes ***

ESC key - ^[ means Control-LeftSquareBracket which is ASCII 27 which is ESC

ESC => ^[
up => ^[OA
down => ^[OB
right => ^[OC
left => ^[OD
home => ^[[1~
end => ^[[4~
F1 => ^[[11~
F12 => ^[[24~

.END