[cpia] VIDIOCSWIN/reset_camera_struct and weird colors

Nicolas Roussel nicolas.roussel@gmd.de
Thu, 24 Feb 2000 16:20:39 +0100 (CET)


Hi,

I use a USB Creative Webcam II with Linux 2.3.47. I really like the
0.7.1 driver which is far better than the one in the kernel...

However, I found two strange things.

1) VIDIOCSWIN and reset_camera_struct

  I usually grab images at QCIF resolution (176x144). It works well
  the first time I run my application, but fails the second time when
  trying to read an image. If I go on trying to run the application,
  it works again after some time.

  When this happens, the driver says "count wrong". The values
  indicate that it grabbed a full CIF image instead of a QCIF.

  If I comment out the line

    if(vw.width!=cam->vw.width || vw.height!=cam->vw.height) {

  in the VIDIOCSWIN part of cpia_ioctl, it works perfectly.


  I think this is related to what is done (or not done) in
  reset_camera_struct, but I can't get this right (changing vw.width
  and vw.height in reset_camera_struct doesn't work).

  Any idea of a better fix ?

2) weird colors

  I keep getting images with yellowish/greenish colors. You can see an
  example at http://fit.gmd.de/~roussel/CPiA/ (left is good, right is
  bad...).

  The first image is ALWAYS good. So I guess this has to do with
  auto-expose or something like this. The first image is also always
  better (smoothed). I put the output of /proc/cpia/video0 at the end
  of this message.

  Again, any idea on how to correct this ?

N. Roussel

-- 
________________________________________________________________________

Nicolas Roussel                            mailto:nicolas.roussel@gmd.de
GMD - FIT.HCI, Schloss Birlinghoven      http://www-ihm.lri.fr/~roussel/
53754 St. Augustin, Germany       phone: +49 2241 14-2154 / fax: 14-2065
________________________________________________________________________



read-only
-----------------------
CPIA Version:             1.20 (2.0)
CPIA PnP-ID:              0553:0002:0100
VP-Version:               1.0 0100
system_state:             0x02
grab_state:               0x20
stream_state:             0x00
fatal_error:              0x00
cmd_error:                0x00
debug_flags:              0x00
vp_status:                0x10
error_code:               0x7f
video_size:               QCIF
sub_sample:               422
yuv_order:                YUYV
roi:                      (  0,   0) to (176, 144)
actual_fps:                15
transfer_rate:             729kB/s

read-write
-----------------------  current       min       max   default  comment
brightness:                   50         0       100        50
contrast:                      0         0        96        48  steps of 8
saturation:                   50         0       100        50
sensor_fps:               15.000         3        30        15
stream_start_line:           120         0       144       120
ecp_timing:               normal      slow    normal    normal
color_balance_mode:         auto    manual      auto      auto
red_gain:                     67         0       212        32
green_gain:                    3         0       212         6
blue_gain:                   211         0       212        92
max_gain:                      2             1,2,4,8         2
exposure_mode:              auto    manual      auto      auto
centre_weight:                on       off        on        on
gain:                          2         1  max_gain         1  1,2,4,8 possible
fine_exp:                      2         0       511         0
coarse_exp:                  254         0     65535       185
red_comp:                      0       220       255       220
green1_comp:                   0       214       255       214
green2_comp:                   0       214       255       214
blue_comp:                   137       230       255       230
apcor_gain1:                0x1c       0x0      0xff      0x1c
apcor_gain2:                0x1a       0x0      0xff      0x1a
apcor_gain4:                0x2d       0x0      0xff      0x2d
apcor_gain8:                0x2a       0x0      0xff      0x2a
vl_offset_gain1:              24         0       255        24
vl_offset_gain2:              28         0       255        28
vl_offset_gain4:              30         0       255        30
vl_offset_gain8:              30         0       255        30
flicker_control:             off       off        on       off
mains_frequency:              50        50        60        50 only 50/60
allowable_overexposure:        0         0       255         0
compression_mode:           auto    none,auto,manual      auto
decimation_enable:           off       off       off       off
compression_target:      quality framerate   quality   quality
target_framerate:              7         0        30         7
target_quality:               10         0       255        10
y_threshold:                   7         0        31        15
uv_threshold:                  6         0        31        15
hysteresis:                    3         0       255         3
threshold_max:                11         0       255        11
small_step:                    1         0       255         1
large_step:                    3         0       255         3
decimation_hysteresis:         2         0       255         2
fr_diff_step_thresh:           5         0       255         5
q_diff_step_thresh:            3         0       255         3
decimation_thresh_mod:         2         0       255         2

_______________________________________________
cpia mailing list  -  cpia@risc.uni-linz.ac.at
http://mailman.risc.uni-linz.ac.at/mailman/cgi-bin/listinfo/cpia