maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Multimedia (https://talk.maemo.org/forumdisplay.php?f=32)
-   -   RAW picture taking with N900 (https://talk.maemo.org/showthread.php?t=41336)

ChakiShante 2010-01-19 13:18

RAW picture taking with N900
 
I want to make an N900 application to take RAW pictures and save to a file, with preview. I looked at the other threads about raw photo (SLR controls over N900 and other threads) but none of them actually helped me.

I'm rather new to Linux development, but I am experienced in close-to-the-hardware development, particularly when it comes to TI platforms.

- is this functionality exposed yet in GStreamer (or any plug-in) ? I looked at camerabin and digicam but didn't find anything. Any relevant link appreciated.

- do I have to write a GStreamer plugin myself ? is this something that can be done at the user level or kernel level ?

- if I need to make a plug-in, I could somebody point me to how I could do that using ESBox ? there are not many links about how to use it to build GStreamer and plug-ins

- ideally, I'd prefer doing all this in python rather than C, is that possible at all ? Are camerabin and other plug-ins exposed through Python bindings ?

Thanks all.

Wes79 2010-01-19 13:21

Re: RAW picture taking with N900
 
This would be an awesome app. an most definately something I'd use! I do a lot of live music photography and want to expand that when out on tour with bands to do micro blogging direct to a bands website with tour photos and a RAW application for when I can't easily use my DSLR would be great!

Just thought I'd add my support! :D

ndi 2010-01-19 16:58

Re: RAW picture taking with N900
 
While nothing to sneeze at, I agree, how much of a quality gain to you expect from the cam? I mean, considering the optics, sensor size, etc, not THAT much is lost in JPEG compression.

There's a reason everyone uses JPEG instead of ,say, PNG which is open and lossless. JPEG compresses better at much lower cost cor both compression and decompression. Compressing and writing a PNG could take many seconds.

Most RAW formats (except for uncompressed RAW) are compressed, if lossless. Uncompressed, an image from the camera is 15MB, that takes up to 8 seconds to write on a standard card.

Again, it's not like I don't want it, I'm simply raising a few questions for discussion. Not a developer on Linux, but a developer and an amateur photographer.

Wes79 2010-01-19 17:03

Re: RAW picture taking with N900
 
That is a good point, my DSLR writes RAW files that are 23mb! Although this is very quick using a class6 memory card, it would probably be a nightmare on the n900! Hmmm :eek:

thorbo 2010-01-19 17:08

Re: RAW picture taking with N900
 
Has anyone tried to change the various file types to be saved via the camera .config file? I have not, as I use my phone for work a good deal and don't want to brick it, and I am personally not sure which file types are supported. However; If it does .png, perhaps that is the next best alternative.(?)

ChakiShante 2010-01-19 17:14

Re: RAW picture taking with N900
 
I would actually argue that, precisely because of the somewhat limited sensor size, format, capabilities, and optics, we should do everything we can not to add JPEG compression artefacts on top.

Please note that this effort is also a good way for me of better understanding Linux/Maemo development, GStreamer, and OMAP3 drivers.

Bingley Joe 2010-01-19 17:15

Re: RAW picture taking with N900
 
Quote:

Originally Posted by ndi (Post 482298)
While nothing to sneeze at, I agree, how much of a quality gain to you expect from the cam? I mean, considering the optics, sensor size, etc, not THAT much is lost in JPEG compression.

There's a reason everyone uses JPEG instead of ,say, PNG which is open and lossless. JPEG compresses better at much lower cost cor both compression and decompression. Compressing and writing a PNG could take many seconds.

Most RAW formats (except for uncompressed RAW) are compressed, if lossless. Uncompressed, an image from the camera is 15MB, that takes up to 8 seconds to write on a standard card.

Again, it's not like I don't want it, I'm simply raising a few questions for discussion. Not a developer on Linux, but a developer and an amateur photographer.

One big advantage of having access to the RAW output though is that you as the photographer get absolute control over any noise-reduction and sharpening that's applied, which can yield far superior results, IMO, especially in low-light situations.

Professional DNR filters like Neat Image (esp. with a custom N900 profile) or Noise Ninja are always going to do a better job processing the image than the camera's internal software. Not to mention that its white-balaning leaves a bit to be desired..

I'm definitely be interested in seeing where this goes!

rambo 2010-01-19 17:17

Re: RAW picture taking with N900
 
Quote:

Originally Posted by ndi (Post 482298)
While nothing to sneeze at, I agree, how much of a quality gain to you expect from the cam? I mean, considering the optics, sensor size, etc, not THAT much is lost in JPEG compression.

AB (abbra) had a talk about this in the summit.

(BTW: is there a way to ping people about threads on this forum software ?)

In short: if 10sec save times were acceptable you could get pictures of similar quality as high-end "prosumer" cameras (between the basic consumer cameras and DSLRs), can't remember about RAW offhand.

ChakiShante 2010-01-19 17:22

Re: RAW picture taking with N900
 
Quote:

Originally Posted by rambo (Post 482335)
AB (abbra) had a talk about this in the summit.

I did notice this talk but can't seem to find any related presentation material. If you happen to have it or where to find it ... I'm interested.

vvaz 2010-01-19 17:25

Re: RAW picture taking with N900
 
Quote:

Originally Posted by ndi (Post 482298)
While nothing to sneeze at, I agree, how much of a quality gain to you expect from the cam? I mean, considering the optics, sensor size, etc, not THAT much is lost in JPEG compression.

Most JPEG engines are using primitive denoise techniques. By using RAW and taking complete control over this process you can create more eye-pleasing effects. This is especially important in cameras where matrix and optics are low-quality - and objectively N900 stuff is low quality comparing to other photo gear.

IMO by average you can gain 1-2 EV with RAW processing.

ndi 2010-01-19 18:25

Re: RAW picture taking with N900
 
Quote:

Originally Posted by Bingley Joe (Post 482331)
One big advantage of having access to the RAW output though is that you as the photographer get absolute control over any noise-reduction and sharpening that's applied, which can yield far superior results, IMO, especially in low-light situations.

Agreed, that could actually salvage a picture one would otherwise throw away, IF (and I stress) the saving is of the raw info. The HW camera could serve a compressed stream (which I assume it does), in which case the denoise would be almost identical. If it serves only 5% better, waiting 10 seconds is a bad trade-off. Only one in 200 pics would be saved by this, and it would be a bad shot anyway. Sequence shooting would help more.

Quote:

Originally Posted by vvaz (Post 482351)
IMO by average you can gain 1-2 EV with RAW processing.

I am unsure what you mean by 1-2 EV. Exposure values have little impact on pre/post compression, most advantages of EV are due to exposure BEFORE the shot is taken. Once the shot is too dark, stretched, shaken, whatever, there is nothing to gain by RAW. Information has been clipped (or lost if smudged) and I very much doubt N900 has a HDR sensor that has low-light info that gets clipped by JPEG 24 bit compression.

Your statement is only relevant on high-end DSLR sensors that do above eight bit. Normal consumer cameras don't get clipped. E.g., my Sony does 12 bit per pixel, saving in RAW allows me to pull that info by sliding the data over (brightness) or compressing the range (contrast). That info is lost when saved in JPEG. That's why it HAS RAW.

@rambo, "if 10sec save times were acceptable you could get pictures of similar quality as high-end "prosumer" cameras" is a statement that, first of all, refers to best-case scenarios, with good light. A CCD prosumer in low light would be laughing all the way to the bank.

Second of all, there is no replacement for glass. While it is conceivable that in good lighting one could compare an N900 shot to a compact camera (pocket-compact), there is no way it gets comparable shots to a large-glass prosumer, even if the build is electronic and can't change optics, making them non-DSLR (prosumer).

Most of the noise in the shot is inserted by the CMOS sensor that fires up randomly in low light (high noise) - in low light only post-processing saves SOME of the data, but it has to be done inside the camera, since it implies median correction of successive/continuous exposures.

This has little to nothing to do with RAW. It helps a little, but doesn't fix anything.

My bet is the original talk was about post-processing, such as median denoise, precise demosaicing and color balancing. These does not equate in EV-equivalents.

abbra 2010-01-19 20:28

Re: RAW picture taking with N900
 
If you are programming sort of person, look at http://maemo.gitorious.org/maemo-mul...n/gst-camera.c example. In handle_element_message() it shows how to handle RAW data buffer coming from v4l2camsrc, and on_chkbtnRawMsg_toggled() shows how to trigger v4l2camsrc to produce that RAW buffer.

RAW data is 10-bit BAYER (two bytes per element) if I'm not mistaken.

abbra 2010-01-20 11:27

Re: RAW picture taking with N900
 
What goes for low light conditions, ndi is right that it is tough task for sensors in mobile phones and no postprocessing can make a replacement to a good sensor with smaller noise in a low-light conditions.
However, for typical Finnish winter day light conditions (which are far worse than normal light conditions we are assuming usually in such discussions) it is still possible to get good results with N900.
The infrastructure is there, a limiting factor of not supplying the IPP element switched ON by default was processing time as I said. It is program-level decision and has nothing to do with sensor quality.

I would say that many people try to express their opinions in a monochrome style, meaning that opposite for "good" is always "bad" or "evil". Life is full of shades, though. :)

ndi 2010-01-20 13:00

Re: RAW picture taking with N900
 
indeed.

There's a real advantage in doing that, and if the camera serves RAW from the sensor, the gain would be quite hefty, if slow. Not everyone is in a hurry to shoot a sunset.

Just don't expect any miracles. Also, you might have to rewrite the camera app, so you'll be missing loads of features, like tagging, geo-tagging, etc.

ChakiShante 2010-01-20 15:03

Re: RAW picture taking with N900
 
Quote:

Originally Posted by abbra (Post 482700)
If you are programming sort of person, look at http://maemo.gitorious.org/maemo-mul...n/gst-camera.c example. In handle_element_message() it shows how to handle RAW data buffer coming from v4l2camsrc, and on_chkbtnRawMsg_toggled() shows how to trigger v4l2camsrc to produce that RAW buffer.

RAW data is 10-bit BAYER (two bytes per element) if I'm not mistaken.

I managed to build, execute, and debug the example_camera.c application that you mention, using ESBox, on my N900.

When I check the raw message checkbox, some sort of environment variable is set to CAMSRC_PUBLISH_RAW=True somehow. However when I take a snapshot afterwards, the execution flow in handle_element_message keeps going through the .rgb save path, and never goes through .raw path.

All the shots I could take with the raw checkbox checked are thus in .rgb format. I made a short python script to open, read, and dump the data into a PIL image: it is indeed an RGB 888 format, already demosaiced/debayerized.

So it seems I am not able to get any RAW really raw data. What am I missing ? The application GUI is a little messy and one or two elements seem to be a little going out of the screen, is there any other GUI element I should see that would trigger raw format ?

Thanks.

abbra 2010-01-20 16:39

Re: RAW picture taking with N900
 
http://repository.maemo.org/pool/mae...7-2+0m5.tar.gz contains implementation of v4l2camsrc element. You can verify that it is indeed acting properly to non-NULL value of CAMSRC_PUBLISH_RAW environmental variable.

Regarding to the example program, I'm not sure whether it is update itself, I was referring to it purely to show an idea how to trigger the RAW buffer delivery from the v4l2cam.

bachagabriel 2010-05-11 15:46

Re: RAW picture taking with N900
 
Resuscitating the thread:

Can we take raw pictures with gstreamer?

Zoin 2010-12-22 14:11

Re: RAW picture taking with N900
 
For those who came to this thread when googling "N900 raw" or some similar way - Nokia N900 CAN shoot raw, the program is called "FCamera" (http://fcam.garage.maemo.org/fcamera.html)

Em0 2011-12-17 09:49

Re: RAW picture taking with N900
 
Quote:

Originally Posted by Zoin (Post 902050)
For those who came to this thread when googling "N900 raw" or some similar way - Nokia N900 CAN shoot raw, the program is called "FCamera" (http://fcam.garage.maemo.org/fcamera.html)

This is what I'm looking for ... Emm ... I believed People up there had have lost in translating the first thread! Thanks!

:D

peter2p 2011-12-17 10:25

Re: RAW picture taking with N900
 
BlessN900 has also the option to take photos in raw mode.
File is saved as .dng in DCIM folder


All times are GMT. The time now is 10:06.

vBulletin® Version 3.8.8