Thursday, May 5, 2011

Controlling Nikon D40


Introductions:

This time lets try the other brand of camera (Nikon D40X ) and it will be coming from someone who is willing to sponsor for the curiosity of this test.I have mentioned it for the past few weeks and hey the camera just arrived this Friday(May 6,2011 Note::-Pacqiao and Mosely fight can't wait to see it; then Sir Edwin 'Son baptism -Ninong ako..) am so excited to test the scanning software and see if something could happen so different (Canon Vs Nikon)

Requirements:
RoBook Scanner beta-release
Nikon D40X
PC -Fedora OS

Objectives:
To test D40X in our scanning software and see some extra features:

Methodology:

Detail(1)Oh my.. I have a plenty of them


Detail(2) Nikon D40X ready to shoot


Detail(3) Turn off the light and see the working settings


Detail(4) Yes! Its been detected


Detail(5)Lets check gphoto2 first


Detail(6) Let's see what we can tweak(gphoto2 --list-config)


Detail(7) Menu setup (MTP/PTP)


Detail(8) Capture output focusing just the sjubject


Detail(9) Video of controlling D40X


Remarks:

First of all many thanks to Sir Edwin for lending me his personal Camera (Nikon D40X) that I will be using in this test.(..again thanks Sir!)

With the observations I'd experienced , just a little modification for the scanning software then its ready to accommodate all brands of cameras.

Conclusions:

Sunday, April 10, 2011

RoBook Scanner (Video Capture)

Introductions:

Once again, our RoBook Scanner will be on its next level, this is how to incorporate Video capturing on the RoBook Arm.Basically our objective is to guide the Robot itself the variations of its movement and how to adapt every conditions of changing sizes of different books.Anyway, we'll use it to monitor the scanning system's activity and to find out if ever there would be an occurrence of malfunctions and see for ourselves also a real time scenes of RoBook in actions-how about that?

As we've mentioned a while ago, we were using gambas for Linux and the forum now is somewhat asking the examples on how to use "picturebox"to display video files or much better if the features capability should be for a real time video streaming.Well, as the date of writing I don't know much about the updates , but I am trying to seek for a solutions myself.

But before that(our discussion obviously), I have changed my platform -oh- a 64 bit quad core server type DELL computer(a cute monter machine)-How about that bro?I found out again installing Ubunto is different from Fedora ,perhaps the technical terms in spelling per se is different -they have the unique term respectively . So you better use "yum search " to what was you usually did in Ubunt "apt-get" then install it if the file ,package or resources are available-quite tasky.

I have come up to an idea that, I need mplayer to do task (video4Linux perhaps) and a "/video/mywebcam/ " example included in Gambas2 and will try if I could pipe it out in a real video streaming- and lets see-hope we could do that.

Requirements:

Libraries for Mplayer,Xine and VLC:
a52dec.x86_64 0:0.7.4-15.fc11
faad2-libs.x86_64 1:2.7-1.fc11
fribidi.x86_64 0:0.19.2-2.fc12
libdca.x86_64 0:0.0.5-5.fc12
libmpeg2.x86_64 0:0.5.1-8.fc12
libvdpau.x86_64 0:0.4.1-1.fc14.1
lirc-libs.x86_64 0:0.8.7-1.fc14
live555.x86_64 0:0-0.27.2010.04.09.fc14
mplayer-common.x86_64 0:1.0-0.119.20100703svn.fc14
opencore-amr.x86_64 0:0.1.2-1.fc12
xvidcore.x86_64 0:1.2.2-2.fc14

xine-ui.x86_64 0:0.99.6-25.fc14
xine-lib.x86_64 0:1.1.19-2.fc14.1

Objectives:
To include Video Capturing in RoBook Scanning system(period!)

Methodology:

I)Installing Mplayer (Two options: Libna or RPMfusions)
1)Set your proxy for downloads
2) Using Libna repos
rpm -ivh http://rpm.livna.org/livna-release.rpm3) Using RPMfusions repo
3)RPMfusions repo
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
4)Another RPMfusions repo
rpm -Uvh rpmfusion-free-release-stable.noarch.rpm rpmfusion-nonfree-release-stable.noarch.rpm

or you can visit another blog that serves as reference
http://www.redips.net/linux/yum-install-mplayer/
II Coding with Gambas2
0) Click the project->properties->components menu
1) Enable the gb.v4l video capture properties.
2) Requirements for the are gb.qt tool kit , gb.qt setting and etc.(requirements)

Detail(1): Gambas2 Componets


Detail(2) RoBook Arm GUI Interface


Detail(3) Left most side beneath this screen shot is the RoBook'sVideo



Remarks:

Conclusions:

Monday, March 14, 2011

RoBook Scanner II( Automation)

Introduction:

Now is the time to move on to the 2nd phase of the project and that is automating the scanning process.But before anything else , camera automation is our concern first and if we are going to deal it that is the zooming features.
The zooming of a camera is in the category of capture calibration , every time user will be using this features for image viewing adjustment ,the motor is triggered and the actuation pushes the lens and causes its zooming- a requirements in scanning procedures.

Objectives:
To automate the camera capture mode
To sync the camera to the robot arm sensor.
Initial phase of RoBook Scanner automations

Requirements:
1) An installed libgphoto2 and gphoto2 and libraries
2) A Powershot camera (Canon G10)
3) USB Cables

Methodology:
Note:
Please use the gphoto manual to explore further command combinations.At the cli type:
root@localhost# gphoto2 --help

Installation
:

  • Make sure nothing else has access to the camera, and kill any other possible gphoto instances.
root@localhost# ps aux | grep gphoto2
  • kill -9 pidof gphoto2
  • pkill PTP
  • pkill gphoto2

Gphoto Setup Camera:

  • gphoto2 --set-config capture=On
  • gphoto2 --set-config whitebalance=4
  • gphoto2 --set-config zoom=5
  • gphoto2 --set-config assistlight=Off
  • gphoto2 --set-config iso=0
  • gphoto2 --set-config canonflashmode=off
  • gphoto2 --set-config focusingpoint=0

Gphoto Testing Purposes

  • gphoto2 --set-config canonimgquality=0
  • gphoto2 --set-config canonimgsize=3
Gphoto Production Settings
  • gphoto2 --set-config shootingmode=3
  • gphoto2 --set-config aperture=18
  • gphoto2 --set-config shutterspeed=25
  • gphoto2 --set-config iso=0
  • gphoto2 --set-config canonimgquality=1
  • gphoto2 --set-config canonimgsize=1

Gphoto Camera toggle Focus

  • gphoto2 --set-config focuslock=on
  • gphoto2 --set-config focuslock=off

Gphoto Capture interval

Take Photos every 2 minutes

  • gphoto2 --capture-image --interval=180 --frames=0

Take videos every 2 minutes

   gphoto2 --capture-movie=2s --port=usb:001,075

Get battery level

   gphoto2 --get-config batterylevel | grep Current | cut -c 9-13 

Detail(1) Video on G10 Mono capture automation

Detail(2) Video on G10 Stereo capture automations


Detail(3) Gambas (VB for Linux) Test program


Detail(4) Zooming and Remote Controls

Remarks:

Hints:
1) See to it that your PC is able to detect your G10
root@localhost/gphoto2/gphoto2/ ./gphoto2 --auto-detect
2) To set on automating the camera root@localhost/gphoto2/gphoto2/ ./gphoto2 --set-config capture=On root@localhost/gphoto2/gphoto2/ ./gphoto2 --set-config zoom=15
Note: Automation range depend on the zoom level of your camera (what was mine is g10)
3) To automate zooming on multiple cameras , just use the command
root@localhost#:/usr/local/gphoto2/gphoto2# ./gphoto2 --list-ports

Devices found: 7
Path Description
--------------------------------------------------------------
ptpip: PTP/IP Connection
serial:/dev/ttyS0 Serial Port 0
serial:/dev/ttyS1 Serial Port 1
serial:/dev/ttyS2 Serial Port 2
serial:/dev/ttyS3 Serial Port 3
usb:001,024 Universal Serial Bus
usb:001,023 Universal Serial Bus

So you can now freely include the ports and id....
root@localhost# gphoto2 --set-config zoom=20 --port=usb:001,023
root@localhost# gphoto2 --set-config zoom=20 --port=usb:001,024

Or we have the options every time we want to forcibly over write the captured image
root@localhost# gphoto2 --set-config zoom=20 --force-overwrite --port=usb:001,024

Future preferences:
Note:
As much as possible we should be able to zoom out (+) or in (-) an image as added calibration's features.Below are the suggested zoom call function:


# [Initialize Zooming]

def zoom(self,zoom,port)
captureCmd = [
"gphoto2",
"--set-config capture=On"
]
utils.invokeCommandSync(captureCmd, CaptureError, \
"Could not initialize zooming an image")
return zoom

# [Zoom Calibration values]
def zoom(self,zoom,port)
captureCmd = [
"gphoto2",
"--set-config zoom=%" % zoom,
"--port=%" % port
]
utils.invokeCommandSync(captureCmd, CaptureError, \
"Could not zoom an image with the value of %zoom" on \
% port)
return zoom


Conclusions:

So far So near to an end of deploying RoBook Scanner