mobian, pinephone camera, and megapixels
#1
I took my pinephone out in the forest today, even though I thought that the camera wasn’t working well. I discovered a few things: 

Megapixels looks bad currently in Mobian phosh, but does a great job. Although the image in the viewer looks distorted and off color, the resulting photos are decent. 

On the default Mobian image, the photos are saved as dng and tiff files. But if you install dcraw and imagemagick, Megapixels saves both raw dng and jpeg files. 

sudo apt-get install dcraw imagemagick

Here’s more info from the developer:
https://blog.brixit.nl/pinephone-camera-pt4/

This pushes the Pinephone much closer to daily driver for me.
  Reply
#2
Thanks for the tip! Installing dcraw and imagemagick now...
  Reply
#3
(03-13-2021, 02:52 PM)dawg161 Wrote: I took my pinephone out in the forest today, even though I thought that the camera wasn’t working well. I discovered a few things: 

Megapixels looks bad currently in Mobian phosh, but does a great job. Although the image in the viewer looks distorted and off color, the resulting photos are decent. 

On the default Mobian image, the photos are saved as dng and tiff files. But if you install dcraw and imagemagick, Megapixels saves both raw dng and jpeg files. 

sudo apt-get install dcraw imagemagick

Here’s more info from the developer:
https://blog.brixit.nl/pinephone-camera-pt4/

This pushes the Pinephone much closer to daily driver for me.
.jpg format from the camera is nice indeed! Thanks for the tip! Big Grin
  Reply
#4
(03-13-2021, 02:52 PM)dawg161 Wrote: ...
Although the image in the viewer looks distorted and off color, the resulting photos are decent. 
...
If you exit megapixels and restart it, or swap to the front camera and then back to the rear camera then the viewfinder distortion is eliminated.

(03-13-2021, 02:52 PM)dawg161 Wrote: ...
sudo apt-get install dcraw imagemagick
...

You should also install exiftool to get more exif data in your final image
Code:
sudo apt install libimage-exiftool-perl

One thing that still puzzles me though is whether the autofocus is working as well as it could. While the clicking during boot is allegedly related to the autofocus firmware loading and sometimes it seems in my viewfinder the image has re-focussed, my logfile has messages that are less supportive:
PHP Code:
dmesg grep focus
1125.665748ov5640 4-004cov5640_set_ctrl_focusno autofocus firmware loaded
1134.913821ov5640 4-004cov5640_set_ctrl_focusno autofocus firmware loaded 
  • ROCKPro64 v2.1 2GB, 16Gb eMMC for rootfs, SX8200Pro 512GB NVMe for /home, HDMI video & sound, Bluetooth keyboard & mouse. Arch (6.2 kernel, Openbox desktop) for general purpose daily PC.
  • PinePhone Pro Explorer Edition, daily driver, rk2aw & U-boot on SPI, Arch/SXMO & Arch/phosh on eMMC
  • PinePhone BraveHeart now v1.2b 3/32Gb, Tow-boot with Arch/SXMO on eMMC
  Reply
#5
(03-14-2021, 06:53 AM)dukla2000 Wrote:
(03-13-2021, 02:52 PM)dawg161 Wrote: ...
Although the image in the viewer looks distorted and off color, the resulting photos are decent. 
...
If you exit megapixels and restart it, or swap to the front camera and then back to the rear camera then the viewfinder distortion is eliminated.

(03-13-2021, 02:52 PM)dawg161 Wrote: ...
sudo apt-get install dcraw imagemagick
...

You should also install exiftool to get more exif data in your final image
Code:
sudo apt install libimage-exiftool-perl

One thing that still puzzles me though is whether the autofocus is working as well as it could. While the clicking during boot is allegedly related to the autofocus firmware loading and sometimes it seems in my viewfinder the image has re-focussed, my logfile has messages that are less supportive:
PHP Code:
dmesg grep focus
1125.665748ov5640 4-004cov5640_set_ctrl_focusno autofocus firmware loaded
1134.913821ov5640 4-004cov5640_set_ctrl_focusno autofocus firmware loaded 
Thank you, all of that helped. I’m glad to have the exif data!
  Reply
#6
any idea why i cant get my pics to photos. or any place else. i have imagemagic . cant seen to find my pics.
  Reply
#7
Hoping for the benefits described here and on developer Martijn Braam's webpage, I did "sudo apt install dcraw imagemagick" but I think it actually broken Megapixels functionality. Prior to installing the additional image processing packages, Megapixels produced both .dng and .tiff files. Now I only get .dng (no new .jpg functionality either). Perhaps there's another reason for the change in bahavior. I last took photos about a week ago and .tiff files were produced.

I tried "sudo apt purge dcraw imagemagick" but no luck getting automatic .tiff conversion back.

Any ideas or suggestions? Thanks!
  Reply
#8
(03-25-2021, 12:50 PM)ncc Wrote:
(03-25-2021, 12:43 PM)calinb Wrote: Hoping for the benefits described here and on developer Martijn Braam's webpage, I did "sudo apt install dcraw imagemagick" but I think it actually broken Megapixels functionality. Prior to the installing the additional image processing packages, Megapixels produced both .dng and .tiff files.  Now I only get .dng (no .jpg). Perhaps there's another reason for the change in bahavior. I last took photos about a week ago and .tiff files were produced.

I tried "sudo apt purge dcraw imagemagick" but no luck getting automatic .tiff conversion back.

Any ideas or suggestions? Thanks!

i get only .dng files too! before that it saved to .dng and .jpg files.. i think the change happend at the moment where they introduced the qr-code reading feature
Thanks. That's bad news!

In an attempt to learn / debug the behavior of the script and its interaction with Megapixels output, I renamed some .dng files in my Pictures folder to 1.dng, 2.dng, 3.dng, etc. Then I issued the command.

"/usr/share/megapixels/postprocess.sh /home/mobian/Pictures test"

and the result was it deleted my entire Pictures subdirectory with all my (wanted) pictures in it! Cry

I guess I should have studied the script code before trying to use it manually!

I think I'll just run dcraw from the terminal to do my conversions manually for now.

Okay, I got my .tiff output back. It turns out that I didn't purge / remove imagemagick when I thought I had.

Once I actually removed imagemagick (while retaining dcraw), the .tiff files were automatically produced by the megapixels postprocess.sh script again. I suspect that when imagemagick is installed, postprocess.sh tries to produce a .jpg from the dcraw .tiff but the conversion is failing for some reason and postprocess.sh deletes the .tiff. file.

I don't have time to study the script and figure out what is happening now but It would probably take me far less time to find a lightweight .tiff to .jpg converter and write my own script. Ever since I got my PinePhone late last year, I've been copying the .tiff files over to my MX Linux laptop and using gimp to convert to other compressed formats, when desired (because .tiff is huge, of course).

Maybe megapixels dev,  Martijn Braam, would respond to a bug report, but I haven't found where to file one. There's more info here:
https://git.sr.ht/~martijnbraam/megapixels
  Reply
#9
(03-25-2021, 12:43 PM)calinb Wrote: Hoping for the benefits described here and on developer Martijn Braam's webpage, I did "sudo apt install dcraw imagemagick" but I think it actually broken Megapixels functionality. Prior to installing the additional image processing packages, Megapixels produced both .dng and .tiff files.  Now I only get .dng (no new .jpg functionality either). Perhaps there's another reason for the change in bahavior. I last took photos about a week ago and .tiff files were produced.

I tried "sudo apt purge dcraw imagemagick" but no luck getting automatic .tiff conversion back.

Any ideas or suggestions? Thanks!

There are all kinds of revision challenges going on, think megapixels is the victim rather than the cause. For sure my current Mobian install will not produce anything other than a .dng in ~/Pictures/.

On the other hand my Arch install is doing great, including decoding QR codes. Revisions (on Arch) are:
megapixels 0.15.0-1
imagemagick 7.0.11.4-1
dcraw 9.28.0-2
perl-image-exiftool 12.16-1 (yes I know the Mobian package name is different)

Next time I boot Mobian will check the revs there.
  • ROCKPro64 v2.1 2GB, 16Gb eMMC for rootfs, SX8200Pro 512GB NVMe for /home, HDMI video & sound, Bluetooth keyboard & mouse. Arch (6.2 kernel, Openbox desktop) for general purpose daily PC.
  • PinePhone Pro Explorer Edition, daily driver, rk2aw & U-boot on SPI, Arch/SXMO & Arch/phosh on eMMC
  • PinePhone BraveHeart now v1.2b 3/32Gb, Tow-boot with Arch/SXMO on eMMC
  Reply
#10
(03-25-2021, 01:32 PM)calinb Wrote: In an attempt to learn / debug the behavior of the script and its interaction with Megapixels output, I renamed some .dng files in my Pictures folder to 1.dng, 2.dng, 3.dng, etc. Then I issued the command.

"/usr/share/megapixels/postprocess.sh /home/mobian/Pictures test"

and the result was it deleted my entire Pictures subdirectory with all my (wanted) pictures in it! Cry

I'm sorry to read you lost your images, but you are absolutely right, reading only the introductory comment lines, especially the last two of them, would have helped:

# The post-processing script is responsible for cleaning up
# temporary directory for the burst.


I can confirm that the software combination (Megapixels with the current postprocessing script) just produces .dng files. Curiously, if I manually prepare files and start the script, it does produce .jpg files:

Maus@pine:~$ bash -x /usr/share/megapixels/postprocess.sh /tmp/test test
+ '[' 2 -ne 2 ']'
+ BURST_DIR=/tmp/test
+ TARGET_NAME=test
+ MAIN_PICTURE=/tmp/test/1
+ cp /tmp/test/1.dng test.dng
+ DCRAW=
+ TIFF_EXT=dng.tiff
+ command -v dcraw_emu
+ '[' -x /usr/lib/libraw/dcraw_emu ']'
+ DCRAW=/usr/lib/libraw/dcraw_emu
+ set -- -fbdd 1
+ CONVERT=
+ command -v convert
+ CONVERT=convert
+ set -- -fbdd 1
+ '[' -n /usr/lib/libraw/dcraw_emu ']'
+ /usr/lib/libraw/dcraw_emu +M -H 4 -o 1 -q 3 -T -fbdd 1 /tmp/test/1.dng
+ '[' -n convert ']'
+ '[' convert == convert ']'
+ convert /tmp/test/1.dng.tiff -sharpen 0x1.0 test.jpg
+ command -v exiftool
+ exiftool -tagsFromfile /tmp/test/1.dng.tiff -software=Megapixels -overwrite_original test.jpg
    1 image files updated
+ echo test.jpg
test.jpg
+ rm -rf /tmp/test

Works as designed, I'd say, so I have to inspect Megapixels why it does not call the postprocessing that way (or why it fails to do so).
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  bookworm vs trixie discussion for mobian in pinephone regular. zetabeta 14 1,345 03-14-2024, 10:12 AM
Last Post: Faded
  The program doesn`t detect the camera blag0rag 2 176 02-15-2024, 08:03 PM
Last Post: Kevin Kofler
  unofficial kali linux for pinephone help needed pinesmell 5 3,422 01-08-2024, 02:50 PM
Last Post: ERPlegend
  mobian installed to eMMC - how to install tow-boot grump_fiddle_reinstall 6 1,610 11-22-2023, 11:46 AM
Last Post: aLoop100o
  What actions needed to keep on mobian testing user641 3 1,633 09-05-2023, 06:44 AM
Last Post: Zebulon Walton
  Mobian boot failed with zstd message after upgrade. Mahgue 0 569 09-01-2023, 11:29 AM
Last Post: Mahgue
  [Megapixels] Flash strobe, pictures viewer and MPCamera error 22 freelectro 1 1,041 08-30-2023, 03:59 AM
Last Post: karensather
  GStreamer Camera Issue (Unsupported pixformat: 0x56595559 with mbus code: 0x3001) sog8b 1 1,117 07-17-2023, 01:49 AM
Last Post: junelung
  how to update mobian over tor vusra 13 6,471 07-09-2023, 08:57 PM
Last Post: vusra
  opensnitch outbound firewall now works on mobian vusra 2 1,790 07-09-2023, 01:37 AM
Last Post: vusra

Forum Jump:


Users browsing this thread: 1 Guest(s)