I came up with a simple (i.e. very dumb, perhaps too much so) program
   to generate a histogram of a Y4MPEG2 frame.   Using the program on
 
Have you tried yuvcorrect -M STAT?  It makes frame-by-frame histograms
in YCbCr and RGB.  I used it a little earlier to investigate the range
of my camera; here is part of the histogram for a shot of the lens cap
with exposure compensation turned down as much as I could (to try and
keep the CCD noise to a minimum; as I might have mentioned 80 times by
now, my camera is noisy):

   INFO: [yuvcorrect] Histogramme
i Y U V
...
   INFO: [yuvcorrect] 016 00000 00000 00000
   INFO: [yuvcorrect] 017 00000 00000 00000
   INFO: [yuvcorrect] 018 00000 00000 00000
   INFO: [yuvcorrect] 019 00000 00000 00000
   INFO: [yuvcorrect] 020 00041 00000 00000
   INFO: [yuvcorrect] 021 00432 00000 00000
   INFO: [yuvcorrect] 022 02900 00000 00000
   INFO: [yuvcorrect] 023 09386 00000 00000
   INFO: [yuvcorrect] 024 16027 00000 00000
   INFO: [yuvcorrect] 025 16109 00000 00000
   INFO: [yuvcorrect] 026 12281 00000 00000
   INFO: [yuvcorrect] 027 09313 00000 00000
   INFO: [yuvcorrect] 028 06954 00000 00000
   INFO: [yuvcorrect] 029 04929 00000 00000
   INFO: [yuvcorrect] 030 03300 00000 00000
   INFO: [yuvcorrect] 031 02051 00000 00000
   INFO: [yuvcorrect] 032 01248 00000 00000
   INFO: [yuvcorrect] 033 00681 00000 00000
   INFO: [yuvcorrect] 034 00384 00000 00000
   INFO: [yuvcorrect] 035 00204 00000 00000
   INFO: [yuvcorrect] 036 00091 00000 00000
   INFO: [yuvcorrect] 037 00041 00000 00000
   INFO: [yuvcorrect] 038 00014 00000 00000
   INFO: [yuvcorrect] 039 00008 00000 00000
   INFO: [yuvcorrect] 040 00005 00000 00000
...
   INFO: [yuvcorrect] 124 00000 00000 00000
   INFO: [yuvcorrect] 125 00000 00031 00000
   INFO: [yuvcorrect] 126 00000 06528 00168
   INFO: [yuvcorrect] 127 00000 63498 34962
   INFO: [yuvcorrect] 128 00000 16180 49779
   INFO: [yuvcorrect] 129 00000 00163 01486
   INFO: [yuvcorrect] 130 00000 00000 00005
...

So it looks like I have less of a spread than you, especially in CbCr.

Sounds like you want to apply a nonlinear mapping that squeezes your
darker pixels closer together but leaves the rest alone.  Perhaps a
piecewise-linear extension to yuvcorrect?  Have you tried adjusting
the gamma (a power nonlinearity curve) via yuvcorrect?  That might
have a similar effect.  Or, you could just clip below some "black"
threshold, and then restretch what remains to the full range,
something like:
yuvcorrect -Y Y_1.0_28_235_16_235
or just clip:
yuvcorrect -Y Y_1.0_28_235_28_235
or clip and shift down (makes it darker though):
yuvcorrect -Y Y_1.0_28_235_16_223

I hope that the encoder doesn't waste a lot of bits encoding chroma
for such low luma, as the eye can't distinguish dark colors so well.

Dan



-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to