Author Topic: Camera  (Read 5696 times)

drpeter

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • http://
Camera
« Reply #30 on: December 16, 2019, 12:23:29 am »
Quote from: vader
Quote from: drpeter
Small correction: according to the link it's a 1/2.8" format sensor  
Yep, absolutely correct, I didn't pick that one up

Also, are you sure it's this exact sensor?

Open Camera reports the max resolution as 5632 x 4224, which is slightly different to the 5664 x 4256 of this sensor (but the same as the main rear camera used in in the Galaxy A9, for example)

shuntcap

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Camera
« Reply #31 on: December 16, 2019, 01:52:14 am »
Quote from: drpeter
IMHO if you need better than full 8MP spatial resolution (which you don't for viewing snaps on a phone screen), you still need to buy and suffer the inconvenience of carrying a 'proper' camera- you can get a pretty good one second-hand for much less than the difference in price between a Cosmo and a high-end phone.  Not forgetting the myriad other advantages a 'proper' camera will inevitably have over any phone camera for 'serious' as opposed to 'snap' photography.
The only good thing that came out of the Gemini's miserable rear camera, for me at least, was that I rediscovered the joy of using point-and-shoot cameras with true optical zoom lenses, not the fuzzy digital zoom garbage that cell phone cameras use.  That's just software scaling.  I regularly carry a Sony WX350 pocket camera, which is a mere 1" thick yet packs a 20x optical zoom.  That camera is so small it fits in the coin pocket of my jeans.  When I want better image quality or more manual control, I carry a still pocketable but bulkier Lumix ZS200 with a 1" sensor and 15x optical zoom: great image quality even in low light with an incredible optical zoom in a 1.8" thick package.  With cameras this small, the inconvenience of carrying a proper camera becomes quite unnoticeable (unless you're a fan of ultra-tight pants).

With that in mind, the 16MP camera on my Moto Z Play actually resolves more detail than the 18.2MP Sony WX350 at wide angle and about as much detail as the 20MP Lumix ZS200 at wide angle due to its high quality lens (in good lighting only), so cell phone cameras can attain decent resolutions.  Of course, that goes out the window once you hit the zoom controls on the real cameras.  Disclaimer: I only bought the Moto Z Play because I backed the failed keyboard mod project on IGG, which led to the creation of the F(x)Tec Pro1.  I despise virtual keyboards.

shuntcap

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Camera
« Reply #32 on: December 16, 2019, 02:10:10 am »
Quote from: drpeter
Also, are you sure it's this exact sensor?

Open Camera reports the max resolution as 5632 x 4224, which is slightly different to the 5664 x 4256 of this sensor (but the same as the main rear camera used in in the Galaxy A9, for example)
I asked Planet what sensor is used.  They didn't know the part number, but said it's a 24MP Samsung sensor (and confirmed that their original response of a 20MP sensor was a typo).  There are only two Samsung mobile image sensors in 24MP, the S5K2X7 and the S5K2XA, both of which claim a resolution of 5664x4256.  In the world of real cameras, two specs are often given: sensor resolution and effective resolution.  There's usually a small crop of the sensor's full resolution due to the optics or packaging in front of it.  If you could view the RAW image, you'd likely see the shadow of the lens barrel or at least some barrel distortion that is cropped out or otherwise removed during JPEG processing, thus reducing the final image resolution.

shuntcap

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Camera
« Reply #33 on: December 16, 2019, 02:33:50 am »
Quote from: vader
With the right settings, however, it can produce excellent results.
Thanks, vader.  Maybe I'll open my Cosmo after all.  Now I'm just worried about getting a lemon!

Are you able to control binning in OpenCamera?  Looking back at [a href=\'index.php?act=findpost&pid=293314\']fluffypony's images[/a] and [a href=\'index.php?act=findpost&pid=293318\']Daniel W's take on them[/a], it looks like pixel binning was employed when it didn't need to be since there was adequate lighting as evidenced by the low ISO rating in the EXIF data.  When viewed at 100%, do you see this stair-stepping pattern in your images or do you see crisp diagonals like in fluffypony's iPhone sample?  There's no good reason that a 24MP camera would resolve only a fraction of the detail of another 12MP camera unless perhaps pixel binning is forced.  The iPhone is expensive, but the camera sensor isn't anything magical: 12MP is just 12MP.

novaldex

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Camera
« Reply #34 on: December 16, 2019, 05:00:13 am »
With my Gemini I was trying (but failed) to install the Moments Pro camera app. It requires Camera API2.

I put it on my Cosmo pretty quickly and it works well. Okay, i'm still learning, but it does seem to allow me to tweak various settings pretty well, although i've not found anything about resolution yet. Still working on it

If it truly is a 6MP sensor i'll be happy with that, i'd rather it worked at a decent quality all the time rather than stretched itself & reduced quality in the end.

For proper photos i'll carry my Canon 80D when I need it.

rachid

  • Newbie
  • *
  • Posts: 8
    • View Profile
Camera
« Reply #35 on: December 16, 2019, 05:20:05 pm »
Quote from: shuntcap
Quote from: drpeter
Also, are you sure it's this exact sensor?

Open Camera reports the max resolution as 5632 x 4224, which is slightly different to the 5664 x 4256 of this sensor (but the same as the main rear camera used in in the Galaxy A9, for example)
I asked Planet what sensor is used.  They didn't know the part number, but said it's a 24MP Samsung sensor (and confirmed that their original response of a 20MP sensor was a typo).  There are only two Samsung mobile image sensors in 24MP, the S5K2X7 and the S5K2XA, both of which claim a resolution of 5664x4256.  In the world of real cameras, two specs are often given: sensor resolution and effective resolution.  There's usually a small crop of the sensor's full resolution due to the optics or packaging in front of it.  If you could view the RAW image, you'd likely see the shadow of the lens barrel or at least some barrel distortion that is cropped out or otherwise removed during JPEG processing, thus reducing the final image resolution.

I found some references for S5K2X7 in the kernel files:
https://github.com/gemian/cosmo-linux-kerne...&q=++s5k2x7
Not sure if that helps...

shuntcap

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Camera
« Reply #36 on: December 16, 2019, 06:31:22 pm »
Quote from: rachid
I found some references for S5K2X7 in the kernel files:
https://github.com/gemian/cosmo-linux-kerne...&q=++s5k2x7
Not sure if that helps...
Thanks!  I checked the Gemian github page the other day but somehow totally overlooked the Cosmo kernel source!  Must have been distracted by my children... yeah, that's it...

Looking at drivers/misc/mediatek/imgsensor/src/common/v1_1/s5k2x7_mipi_raw/s5k2x7mipiraw_Sensor.c, it follows the same general format as other camera sensor drivers in the MediaTek kernels.  But this setting caught my eye:
        .sensor_output_dataformat = SENSOR_OUTPUT_FORMAT_RAW_Gr,//SENSOR_OUTPUT_FORMAT_RAW_4CELL_Gr,//SENSOR_OUTPUT_FORMAT_RAW_Gr,/* sensor output first pixel color */
The options for that variable are enumerated in drivers/misc/mediatek/imgsensor/inc/kd_imgsensor_define.h.  It's interesting that there are a bunch of "4CELL" formats, possibly for Tetracell sensors.  grep'ing through the other *s5*.c files shows a couple other Tetracell sensors that use 4CELL formats (20MP and 16MP sensors), while the two 24MP sensors do not.

Unfortunately, all of the initialization code is just magic numbers: register writes with no documentation.

I doubt I'll have time to try rebuilding and flashing a new kernel before the new year.  Maybe by then I will have finally opened my Cosmo...
« Last Edit: December 17, 2019, 01:26:54 am by shuntcap »

Daniel W

  • Full Member
  • ***
  • Posts: 248
    • View Profile
Camera
« Reply #37 on: February 13, 2020, 05:49:17 pm »
As the stock camera app is quite barren, I tried using Open Camera, but even though I've set the preview size to match the photo size, they don't match. Were I, for example, to carefully frame, say, my computer keyboard such that it exactly fills the width of the preview, and then press the shutter, the resulting photo is quite a bit wider in all directions, as if the preview was a bit cropped on all sides. It doesn't seem to matter what resolution I pick.

When doing the same thing in the stock camera app, the preview and the final photo matches much better, but there are so many other things that app can't do, so I'd like to be able to use Open Camera instead, but then I'd of course need to figure out how to get a correct viewfinder image. Any ideas, anyone?

Another issue I have is that, since the current camera driver seems to be doing a 2x2 pixel binning even in good light, my 24MP images only has about 6MP worth of details in them. That's usually enough for me, so I'd like to set the resolution to half the cameras native resolution, both ways, which would be 2816x2112. Reasonably, a sensor made with 2x2 binning in mind, would have a mode to output exactly half its native resolution, both ways, but the driver doesn't seem to allow that, which I find a bit weird. My only workaround right now is to shoot at 24MP, then use a photo editor to get down to 6MP and overwrite the original photo. Is there perhaps some app that could automate this, each time I take a picture, such that I wouldn't have to do it manually?

shuntcap

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Camera
« Reply #38 on: February 13, 2020, 08:22:54 pm »
Quote from: Daniel W
As the stock camera app is quite barren, I tried using Open Camera, but even though I've set the preview size to match the photo size, they don't match. Were I, for example, to carefully frame, say, my computer keyboard such that it exactly fills the width of the preview, and then press the shutter, the resulting photo is quite a bit wider in all directions, as if the preview was a bit cropped on all sides. It doesn't seem to matter what resolution I pick.
Odd.  I don't have that issue with OC (version 1.47.3).  Preview is set to WYSIWYG.  I tried both 4:3 and 16:9 aspect ratios.  All preview images match the output JPEG image in terms of framing (both width and height).

Quote from: Daniel W
Another issue I have is that, since the current camera driver seems to be doing a 2x2 pixel binning even in good light, my 24MP images only has about 6MP worth of details in them. That's usually enough for me, so I'd like to set the resolution to half the cameras native resolution, both ways, which would be 2816x2112. Reasonably, a sensor made with 2x2 binning in mind, would have a mode to output exactly half its native resolution, both ways, but the driver doesn't seem to allow that, which I find a bit weird. My only workaround right now is to shoot at 24MP, then use a photo editor to get down to 6MP and overwrite the original photo. Is there perhaps some app that could automate this, each time I take a picture, such that I wouldn't have to do it manually?
You could just set OC to shoot at 4.9MP, swallow the detail loss, and pretend the year is 2011.  Just kidding, I know you want 6MP.  You're 100% correct, though, this sensor only outputs 6MP of detail.  Calling it 24MP is a marketing scam.  24MP and 6MP photos show the exact same level of detail, with the 24MP version just scaled up.  I've given up on the Cosmo camera.  I just carry a tiny Sony WX350 (with true 20x optical zoom) when I want to pack light.  But eventually I will play around with the camera driver code to see 1) if I can disable binning, and 2) if I can add a 6MP option.  I'm not too optimistic, though.

Daniel W

  • Full Member
  • ***
  • Posts: 248
    • View Profile
Camera
« Reply #39 on: February 14, 2020, 05:30:50 am »
Quote from: shuntcap
Odd.  I don't have that issue with OC (version 1.47.3).  Preview is set to WYSIWYG.  I tried both 4:3 and 16:9 aspect ratios.  All preview images match the output JPEG image in terms of framing (both width and height).
Thanks for checking. In the settings of Open Camera (1.47.3), I found that video stabilization was on. Apparently, that also affects the photo mode viewfinder. While the viewfinder IS a kind of video, I suspect OC isn't supposed to apply the stabilization setting in photo mode. After turning video stabilization off, my photo viewfinder now shows the full view.

Quote from: shuntcap
You could just set OC to shoot at 4.9MP, swallow the detail loss, and pretend the year is 2011. Just kidding...
Well, that's what I'm doing for now, and five-ish MP is quite ok for my photo diary. The reason I'd want exactly half the sensor resolution is to minimize interpolation, to get as much detail as possible out of the megapixel count. I do have an app that can do batch resampling of 24MP images, but that means JPEG compressing each image twice, which isn't optimal.

[Edit]:Btw. for phones, 2011 is spot on, as I had a 5MP 2009 Nokia E72 until June, though as I mostly used dedicated cameras back then, to hit 5MP, I need to go back to my 5MP Canon Digital IXUS 500, replaced in 2005 by the 7MP IXUS 700.

Quote from: shuntcap
Calling it 24MP is a marketing scam.
Yeah, but who's scamming? The (Samsung?) sensor has about 24 million photosites, so they're not lying per se. Planet just quotes a datasheet, and MediaTek doesn't really promise anything. Yet, the camera driver (by MediaTek?) seems to always do 2x2 binning - even on the Gemini. I've downsampled its 5MP images to exactly half resolution, both ways, with no loss of detail. But the Gemini at least HAS a mode for exactly 1280x960, while the Cosmo doesn't have a 2816 x 2112 mode, which I would be happy to use, if available.
« Last Edit: February 14, 2020, 08:51:07 am by Daniel W »

NormMonkey

  • Full Member
  • ***
  • Posts: 110
    • View Profile
Camera
« Reply #40 on: February 14, 2020, 01:31:25 pm »
At this point all we can do is hope that MediaTek will update their driver to suck less or at least allow raw access.  Maybe PlanetC can be motivated to apply some pressure on MediaTek.  The camera was a strong selling point and still is per their sales page: "ULTIMATE CAMERA - High resolution 24 megapixel camera with flash for perfect pictures and video".

At this point, my two biggest wants from PlanetC are:
* A fix for the poor battery life
--- * If PlanetC can rework their firmware / drivers to let the thing achieve sleep, I imagine our Cosmos could at least last a weekend without needing a charge.
--- * I charge nightly and usually end the day around 25% to 40% depending how much I used it.
* A fix for the potato-quality camera
--- * If the sensor really is 24MP; and
--- * If the shite quality is down to a poor driver; then
--- * This should be a solveable problem

I'm not holding my breath on either of those things, though.

I went for the Cosmo for two reasons:
* Physical keyboard
--- * Awesome out of the box
--- * Breaks in and gets better with use
* Linux
--- * My original expectation was dual-boot; but
--- * Now it looks like Devuan-over-Android may be a better option
-- -- * Achievable immediately;
-- -- * without having to re-partition the device storage; and
-- -- * without wiping all my existing data and setup

guizmox

  • Newbie
  • *
  • Posts: 7
    • View Profile
Camera
« Reply #41 on: February 17, 2020, 08:54:32 am »
I would like to know the Camera API 2 compatibility mode provided by the driver (full, limited, legacy)
Can someone provide me the information ?

Thank you

guizmox

  • Newbie
  • *
  • Posts: 7
    • View Profile
Camera
« Reply #42 on: February 25, 2020, 04:34:47 am »
I made a few comparison tests between Cosmo Camera & Key2 Camera and will soon post them here.

- Cosmo has a 24mp Samsung 4/3 Tetracell sensor (S5K2X7), 2.8 aperture size, focal length = 300mm
- Key2 has a 12 mp Samsung 4/3 Isocell sensor (S5K2L9), 1.8 aperture size, focal length = 389mm (a little wider compared to the cosmo)

I perform 3 tests using manual camera modes and using a 4000k white balance. I used the Key2 default camera app as it allows full camera controls (Key2 does not provide Camera 2 API, I can't use manual parameters on any other app) and Open Camera for the Cosmo (Cosmo supports Full Camera 2 API)

- ISO : 100, Shutter Speed : 1/15s
- ISO : 800, Shutter Speed : 1/125s
- ISO : 3200, Shutter Speed : 1/500s

What I observed so far :
- The device color calibration is not the same on both devices. Using the same white balance does not provide the exact same colors on final pictures (I obviously checked the results on a computer)

- Cosmo takes pretty good pictures at low ISO levels. Both devices performs quite equally if ISO < 800.

- At high ISO levels, Cosmo produces weird vertical lines, everything is over-denoised and blurry, more than with the Key2 (hard to tell is that post-processing is done in hardware or software)

- Both devices perform poorly on low-light situations. I suspect the lens to be crap on both devices : a lot of artifacts in low-light make me think about a low-quality lens (ex : the more you go away from the center of the picture, the more you have distorded perspectives and blur starts to appear)

- The Cosmo has a larger focus range : I can take macro-photos and get the focus where the Key2 is unable to focus.

- The Cosmo autofocus is SLOOOOOWWWWW....

Will post some pictures soon.
« Last Edit: February 25, 2020, 04:30:23 am by guizmox »

Zarhan

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Camera
« Reply #43 on: February 25, 2020, 05:03:36 am »
Did we reach some consensus on whether it's essentially waste of space to take photos on Cosmo's default resolution? I have installed opencamera and after fiddling with the settings (e.g. turning off edge enhancement) things seem ok-ish to me, but the image files are quite big.

What would be the correct resolution to use? There doesn't seem to be an option for exactly 1/4 of the maximum (with x and y half of the maximum values).

guizmox

  • Newbie
  • *
  • Posts: 7
    • View Profile
Camera
« Reply #44 on: February 25, 2020, 06:26:00 am »
Yes, I confirm the pixel-binding mode. It's surely driver-coded.
As you can see here : https://1drv.ms/u/s!AjXwOsvc6am5i8YAXZ8...t6xfdw?e=It74IG

I took 3 exact same pictures with 3 resolutions and as we can see, the 24mpx pictures are a 6mpx output resampling...
I'm not telling the pictures are bad, but you can safely choose a 6mpx resolution when taking pictures with the Cosmo
« Last Edit: February 25, 2020, 06:26:18 am by guizmox »