[Prev][Next][Index][Thread]

Is there a picture ??



Paul Rensel writes:
 > Hi all,

 > when i look at the picture, it's almost blank..

Increase your brightness value -- the default is too low on my camera
also.  You might also want to try the following script.  It does
continuous redisplays and lets you frob the various parameters.  Oh,
and I can see that bloom (on my unidirectional port) that Paul Chin
sees, when I do continuous redisplays.  I suspect that something isn't
being reset properly -- it's as if the brightness is wrong (at least
on my machine).

One note about the following script -- my copy of tk can't load PGM
files, so I converted it into .GIF.


#!/usr/local/bin/wish -f

set tempfile "/tmp/tkscan.pgm"
set brightness 135
set contrast 200
set whitebal 128
set xval 160
set yval 120
set bpp 4
set more 1

proc rescan { } {
    global tempfile brightness contrast whitebal bpp xval yval

#    exec ./qcam -p 0x278 -x $xval -y $yval -c $contrast -b $brightness -w $whitebal -B $bpp | ./ppmtogif > $tempfile
    exec ./qcam -p 0x278 -x $xval -y $yval -c $contrast -b $brightness -w $whitebal -B $bpp > $tempfile
    image create photo qcamscan  -file $tempfile
}

proc continuous  { } {
    global more

    .continuous configure -text "Stop" -command "set more 0"
    set more 1
    while {$more} {
	rescan
	update
    }
    .continuous configure -text "Continuous" -command "continuous"
}

proc nextrez { } {
    global xval yval

    if {$xval == 320} {
	.nextres configure -text "160x120"
	set xval 160
	set yval 120
    } elseif {$xval == 160} {
	.nextres configure -text "80x60"
	set xval 80
	set yval 60
    } else {
	.nextres configure -text "320x240"
	set xval 320
	set yval 240
    }
}

proc nextbpp { } {
    global bpp

    if {$bpp == 4} {
	.nextbipp configure -text "64 greys"
	set bpp 6
    } else {
	.nextbipp configure -text "16 greys"
	set bpp 4
    }
}


canvas .c 
button .rescan -text "Rescan" -command "rescan"
button .nextres -text "160x120" -command "nextrez"
button .nextbipp -text "16 greys" -command "nextbpp"
button .continuous -text "Continuous" -command "continuous"
button .quit -text "Quit" -command "exit"
frame .f
scale .f.bright -variable brightness -from 1 -to 255 -orient horiz -label Brightness
scale .f.contrast -variable contrast -from 1 -to 255 -orient horiz -label Contrast
scale .f.whitebal -variable whitebal -from 1 -to 255 -orient horiz -label "White Balance"
pack .f.bright .f.contrast .f.whitebal -fill x
rescan
.c create image 1 1 -anchor nw -image qcamscan
pack .c -fill both -expand 1
pack .f .rescan .continuous -fill x
pack .f .nextres .nextbipp
pack .f  .quit -fill x

References: