Posts: 1 | Thanked: 0 times | Joined on Jan 2009
#61
hi,

just wondering -- is there some magic parameter I can pass that will allow me to control the gain setting on the camera?
 
nwerneck's Avatar
Posts: 304 | Thanked: 233 times | Joined on Jul 2009 @ São Paulo, SP, Brasil
#62
Originally Posted by Benson View Post
That median filter's not what I want; I'm after a temporal filter, i.e. the median of the same pixel in each image, or something combining that and a little (<1px) spatial averaging. By interleaving the images, it's possible to make a spatial filter and downsampling provide temporal filtering.
I tried this right now. I took 25 pictures in low light using

mplayer tv:// -tv driver=v4l2:width=640:height=480:noaudio -vf mirror,flip -vo png:z=0 -frames 25

The first image is one of them. Notice the noise, and my hand in the background picking up a cookie from the jar (many of the first frames had my moving hand in it).

The second image is an average of all 25 images, calculated inside the N800 itself using Graphics Magick

gm convert *png -average final.png

The third image was created as you said, using the "median filter" principle along all 25 images, by sorting the values and picking up the middle one --- this is theoretically just another way to obtain the mean value, btw. To do this I wrote a small python script using the PIL library and pylab, which I attached here for reference.

Notice how my hand almost disappeared, while we can see its shadow in the case of the conventional averaging. It seems there is also a little more contrast, and in some of the black portions of the image (as between the keyboard and the table) we got a lot less of the blue noise.

I hope I can manage to port this python script to the N800. Are these libraries available there? Or will I have to go C?
Attached Images
   
Attached Files
File Type: txt mediana.py.txt (1.8 KB, 237 views)
 

The Following 4 Users Say Thank You to nwerneck For This Useful Post:
JayOnThaBeat's Avatar
Posts: 1,028 | Thanked: 578 times | Joined on Mar 2009 @ Chicago
#63
I don't which I find more odd...

The disappearing hand or that crazy cookie jar!
__________________
maemo.org search
I AM NOT A ROLE-MODEL.
 
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#64
Originally Posted by jere View Post
hi,

just wondering -- is there some magic parameter I can pass that will allow me to control the gain setting on the camera?

yes, lower the framerate, at 5fps the camera produces noticably less grainy images which are merged from all the skipped frames (its suseptable to motion blurring tho - its essentially nightmode on a phonecam)


Originally Posted by nwerneck View Post
I tried this right now. I took 25 pictures in low light using

mplayer tv:// -tv driver=v4l2:width=640:height=480:noaudio -vf mirror,flip -vo png:z=0 -frames 25

The first image is one of them. Notice the noise, and my hand in the background picking up a cookie from the jar (many of the first frames had my moving hand in it).

The second image is an average of all 25 images, calculated inside the N800 itself using Graphics Magick

gm convert *png -average final.png

The third image was created as you said, using the "median filter" principle along all 25 images, by sorting the values and picking up the middle one --- this is theoretically just another way to obtain the mean value, btw. To do this I wrote a small python script using the PIL library and pylab, which I attached here for reference.

Notice how my hand almost disappeared, while we can see its shadow in the case of the conventional averaging. It seems there is also a little more contrast, and in some of the black portions of the image (as between the keyboard and the table) we got a lot less of the blue noise.

I hope I can manage to port this python script to the N800. Are these libraries available there? Or will I have to go C?

very cool, I did experiments like this a while ago.
this overlaying is exactly the same as what the hubble space telescope does - it will repeatedly take shots of the same region of space and overlay them to produce a stunning photograph out of the black nothingness we cannot see.
the cookie jar constellation is spectacular!



as for general camera tips, in liqbase I obtain the images directly as YUV frames (usually at 15fps).
I then de-saturate the UV (Chroma) portions by half before presenting them to the user.
it is the best compromise I could find because the greyscale Luma portion does not bleed and has high definition, it was just more noticable with the color parts.

The other essential thing I did with the camera was running it in half resolution: 320*240
I realise its lower res, but I would rather have sustainable fast low res images which are decent quality than having high res stuff with dropped frames and instability.

(this harks back to the megapixel debate - hubble produces stunning images in only 1mpixel)
where pixels are concerned, I take quality over quantity.
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
 

The Following User Says Thank You to lcuk For This Useful Post:
nwerneck's Avatar
Posts: 304 | Thanked: 233 times | Joined on Jul 2009 @ São Paulo, SP, Brasil
#65
Originally Posted by lcuk View Post
as for general camera tips, in liqbase I obtain the images directly as YUV frames (usually at 15fps).
I then de-saturate the UV (Chroma) portions by half before presenting them to the user.
it is the best compromise I could find because the greyscale Luma portion does not bleed and has high definition, it was just more noticable with the color parts.
Great, I am installing scratchbox right now, and I hope to start some image processing projects soon. Even though the camera is not great and the processor doesn't have that much power available, I see many possibilities with the N800.

By the way, that Alfons Mucha picture is a glass coaster leaning on the cookie jar behind, which is just a glass cylinder.
 
nwerneck's Avatar
Posts: 304 | Thanked: 233 times | Joined on Jul 2009 @ São Paulo, SP, Brasil
#66
I thought about sending another example, to illustrate what we can do, and also report on the development.

First I captured a yuv4mpeg stream, using mplayer

mplayer tv:// -tv driver=v4l2:width=640:height=480:noaudio -vf mirror,flip -vo yuv4mpeg -frames 25

I then split the stream in my desktop, using mplayer again

mplayer ../stream.yuv -fps 8 -vo pnmgmyuv

So I used these YUV-space images with my program, calculating the man values at this color space, then created the RGB PNG files...

The scene was not very dark, but one can see how the noise in the floor and the chair are gone. Moving objects can be a problem, but capturing this stream instead of multiple png files was much quicker.

(well, it seems i can't send the images in their natural size, so youll just have to trust me the filtered looks better )
Attached Images
  
 

The Following 2 Users Say Thank You to nwerneck For This Useful Post:
t_moyashi's Avatar
Posts: 49 | Thanked: 102 times | Joined on Jul 2009 @ 驚く為五郎
#67
Hi!
I found this software for v4l2 devices can improve the quality of n810`s camera .
and I wrote a small script to take a shot.

1. install <libqt3-mt> and apt-get <libgd2-noxpm>
2.download <tas_nameraka.tar.gz> *1 and unpack it
3. run "cd tas_nameraka"
4a. to take a shot , run "./tas_nameraka.sh" ( photos are saved to "`date +%Y-%m-%d-%H-%M-%S`".jpg )
4b .to watch a video from N810's cam under some example settings , run "./video_nameraka.sh" .
(this script uses gst-launch. Thank qole! )
4c. to edit settings of the camera , run "./v4l2ucp /dev/video0" in the background of apps which use the camera.(enjoy so busy task switching)
4d. to save and load camera parameters , run "./v4l2ctrl" in the background of apps which use the camera.(see also"./v4l2ctrl -h")

*1 this archive includes :
tas_nameraka/
tas_nameraka/v4l2ucp # a v4l2 config app for GUI
tas_nameraka/v4l2ctrl #a v4l2 config app for CUI
tas_nameraka/fswebcam #a simple webcam app
tas_nameraka/video_nameraka.sh
tas_nameraka/tas_nameraka.sh
tas_nameraka/camera.settings.photo # config 1
tas_nameraka/camera.settings.video1 # config 2
tas_nameraka/camera.settings.video2 # config 3

Name:  s-v4lucp-screenshot21.jpg
Views: 1904
Size:  21.3 KB
a screenshot of v4lucp
(Setting "maximum exposure time" to 3 seems to always improve the quality.
but ,about other parameters, I have no idea ...)


under default settings

under customized settings

Last edited by t_moyashi; 2009-10-29 at 12:00.
 

The Following 6 Users Say Thank You to t_moyashi For This Useful Post:
Posts: 276 | Thanked: 37 times | Joined on Jun 2009
#68
when i try to use "./v4l2ucp /dev/video0"
terminal says ./v4l2ucp: error while loading shared libraries: libqt-mt.so.3: cannot open shared object file: No such file or directory

can someone help me, i enabled sudo gainroot, put this in the storage memory appplication memory /home/user
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#69
Okay. I'm looking at all of these posts and I'm so confused.

I would just like for the camera to take 2 normal pics per second for so many seconds once the script starts.

I'd like to dump these images somewhere on one of my memory cards.

Could I please get a command line for this?

Thank you.
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#70
Bump because I have no shame.

If anyone has a solution for this, could you please post?

Yeup!
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 17:45.