therealdavidp
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 49
Joined: Tue Jan 07, 2020 9:15 am

Re: Raspberry Pi High Quality Camera

Mon May 11, 2020 11:39 am

With custom WB gains the result looks quite good for a cheap lens
Hi, I'm curious if this is really down to the lens or if there's a more generic failure. If you're able, I'd be interested to know:

1. Can you post the custom WB gains that give the improved result?
2. I can see daylight coming in through the window; is there any other illumination of any sort?
3. If you happen to have one of the "official" lenses, could you try it with one of those? (We have a better understanding of how those behave so the comparison could be informative.)
4. Might you be able to capture a jpg+raw file ("raspistill -r -o file.jpg") and post it in the cloud somewhere? (It's too big for the forum.)

Thanks!

drich
Posts: 33
Joined: Tue Jul 28, 2015 7:36 pm

Re: Raspberry Pi High Quality Camera

Mon May 11, 2020 1:15 pm

Hello,

Here is the command I used for the improved image : raspistill -md 3 -awb off -awbg 2,1.5 -o test.jpg
There is no other light source besides the 3 windows you can see on the picture.

If it can help, by running raspistill -md 3 -t 0 -f -set I have the following results :

Code: Select all

Camera control callback  cmd=0x48435045mmal: Exposure now 33642, analog gain 384/256, digital gain 132/256
mmal: AWB R=675/256, B=531/256
...
after 10 seconds
...
Camera control callback  cmd=0x48435045mmal: Exposure now 39985, analog gain 422/256, digital gain 256/256
mmal: AWB R=674/256, B=531/256

aaaaand now I couldn't help anymore, looks like my camera has burnt... I didn't even touched it, it just stopped working between two shots.
vcgencmd get_camera returns supported=1 detected=1
but running raspistill/vid shows nothing on screen, and verbose reports the following :

Code: Select all

"raspistill" Camera App (commit a246147c21ae Tainted)

Camera Name testc
Width 4056, Height 3040, filename test.jpg
Using camera 0, sensor mode 0

GPS output Disabled

Quality 85, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Time delay 5000, Timelapse 0
Link to latest frame enabled  no
Full resolution preview No
Capture method : Single capture

Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Flicker Avoid Mode 'off'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
Camera component done
Encoder component done
Starting component connection stage
Connecting camera preview port to video render.
Connecting camera stills port to encoder input port
Opening output file test.jpg
Enabling encoder output port
Starting capture -1
After powing-off (avoiding touching it while running), the center of the camera board is almost too hot to touch it.

Since the sellers are out-of-stock and I don't have that much money to spend, I'll have to wait a few weeks before giving it another try.
That's too bad, it wouldn't even last 12 hours..

Edit : wow, I can hear it make a slight high-pitched noise
2nd dit: of course, I tried rebooting, another ribbon cable, and another rPi
3rd: Okay, I just checked, and this happened at the time I tried to capture raw image with the "-r" option. But I don't think this is related (can it be?)

Okay I got it working back again, sorry
The command that blocked it was raspistill -r -f -md 3 -o test.jpg
Unblocked with raspistill -f -t 0 -md 3 --verbose -set

therealdavidp
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 49
Joined: Tue Jan 07, 2020 9:15 am

Re: Raspberry Pi High Quality Camera

Mon May 11, 2020 1:56 pm

Here is the command I used for the improved image : raspistill -md 3 -awb off -awbg 2,1.5 -o test.jpg
Sorry to hear the camera board has died (I assume you can get that replaced under warranty...).

Nonetheless, the information you've sent is interesting. You're manually setting a red gain of 2.0 and a blue gain of 1.5, and that appears about right for daylight coming in through the window, which might be somewhere around 5000K.

Now, for the "official" lenses, the colour gains I would expect for 5000K should be around 2.9 and 1.6, so it really does seem to support the theory that there's way too much red. I'm still struggling a bit to believe the discrepancy can be quite this large, and just for red. There's no very easy way to fix this in the existing camera stack. You do have control of the lens shading tables so you could use that, though it's not lovely. You really need to increase the gains for everything except red (so gr, gb and b) as putting less-than-unity gains into the red table may cause highlights to clip to non-white. Another workaround that may sometimes prove adequate would be to set the AWB to greyworld, but that's not a great solution either, though at least it has the virtue of simplicity.

drich
Posts: 33
Joined: Tue Jul 28, 2015 7:36 pm

Re: Raspberry Pi High Quality Camera

Mon May 11, 2020 2:44 pm

Still don't understand what happened, but it's back to life..

So, I don't have any of the official lenses, but if it can help I have the exact same lens with IR-filter removed, I attached it over the official CS-mount and here is the result : http://drich.fr/m12noir-on-csir-raw.jpg
Raspistill reported
Camera control callback cmd=0x48435045mmal: Exposure now 54956, analog gain 384/256, digital gain 256/256
mmal: AWB R=887/256, B=346/256


Raw picture with my M12-mount and lens with its own IR filter : http://drich.fr/m12ir-on-custom-adapter.jpg
Camera control callback cmd=0x48435045mmal: Exposure now 39785, analog gain 384/256, digital gain 256/256
mmal: AWB R=674/256, B=531/256


Same, but with greyworld AWB : http://drich.fr/m12ir-on-custom-adapter-greyworld.jpg
Camera control callback cmd=0x48435045mmal: Exposure now 39928, analog gain 384/256, digital gain 256/256
mmal: AWB R=551/256, B=374/256
WB seems right here comparing to the first picture.



And in case, this is raw picture with CS-mount IR + M12 lens with IR (double IR filter) : http://drich.fr/m12ir-on-csir-raw.jpg

Thank you for your help :D

Edit: btw, the two IR-filters seem quite different : Image

Edit2: forgot the most important!
Here is the raw image with 2.0 and 1.5 gains (a bit blue-ish at this time of the day) : http://drich.fr/m12ir-on-custom-adapter-2.0-1.5.jpg
Camera control callback cmd=0x48435045mmal: Exposure now 51013, analog gain 384/256, digital gain 256/256
mmal: AWB R=512/256, B=384/256
Last edited by drich on Mon May 11, 2020 3:27 pm, edited 2 times in total.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8688
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Raspberry Pi High Quality Camera

Mon May 11, 2020 2:51 pm

therealdavidp wrote:
Mon May 11, 2020 1:56 pm
You do have control of the lens shading tables so you could use that, though it's not lovely. You really need to increase the gains for everything except red (so gr, gb and b) as putting less-than-unity gains into the red table may cause highlights to clip to non-white.
The hardware won't accept less than unity in any co-efficients, and the setup code should clip it to x1.0 as a minimum anyway.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
HermannSW
Posts: 2543
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Raspberry Pi High Quality Camera

Mon May 11, 2020 6:42 pm

I tested raspivid with framerate 120fps and new HQ camera, and am a bit disappointed.

In order to quantify the many frameskips seen, I updated ptsanalyze tool:
https://github.com/Hermann-SW/userland/ ... ptsanalyze
ptsanalyze.png
ptsanalyze.png
ptsanalyze.png (39.98 KiB) Viewed 1590 times

v1 camera was maximally able to do 640x480 at 90fps, but did that always with 0 frameskips.

Initially v2 camera was capped at 120fps, but it was later allowed for up to 200fps framerate.
The camera can capture framerate 150fps without frameskips:

Code: Select all

$ raspivid -md 7 -w 640 -h 480 -o tst.h264 -pts tst.pts -fps 150
$ ptsanalyze tst.pts | grep -v "^[c >]"
747 frames were captured
majority framerate 150fps
0 frame skips (0%)
average framerate 150fps
$ 

Unlike that, new HQ camera does not come near to real 120fps recording, at mode 4 1016x760.
While majority framerate is 120fps, 26% frameskips lead to only 88fps average framerate.
Storing the files in ramdisk does not make any difference:

Code: Select all

🍓 raspivid --mode 4 -w 1016 -h 760 -o tst.h264 --shutter 1000 -pts tst.pts -fps 120
Too many macroblocks/s: Increasing H264 Level to 4.2
🍓 tools/ptsanalyze tst.pts | grep -v "^[> c]"
430 frames were captured
majority framerate 120fps
154 frame skips (26%)
average framerate 88fps
🍓 

90fps is the highest requested framerate resulting in 0 frameskips.

Code: Select all

🍓 raspivid --mode 4 -w 1016 -h 760 -o tst.h264 --shutter 1000 -pts tst.pts -fps 90
Too many macroblocks/s: Increasing H264 Level to 4.2
🍓 tools/ptsanalyze tst.pts | grep -v "^[> c]"
438 frames were captured
majority framerate 90fps
0 frame skips (0%)
average framerate 90fps
🍓 

Reducing output frame size to 512x384 does not allow for more than 90fps without frameskips (only the h264 4.2 message does not show up while recording):

Code: Select all

🍓 raspivid --mode 4 -w 512 -h 384 -o tst.h264 --shutter 1000 -pts tst.pts -fps 95
🍓 tools/ptsanalyze tst.pts | grep -v "^[> c]"
464 frames were captured
majority framerate 95fps
1 frame skips (0%)
average framerate 94fps
🍓 

I did capture 120fps video of spinning coin (1€) passing through camera view, and it had 26% frameskips.
But the stored timestamp file tst.pts allows fo create a .mkv video with timestamps associated with each frame.
That way the frameskips do not matter that much since video will be played "correctly" because of the timestamps:

Code: Select all

$ raspivid --mode 4 -w 1016 -h 760 -fps 120 -o tst.h264 -t 0 --shutter 1000 -pts tst.pts
$ mkvmerge -o tst.mkv --timecodes 0:tst.pts tst.h264
$
I did upload that video to youtube, and it does not play at 120fps.
With default 480p resolution it plays at 24fps, selecting 720p48 plays it at 48fps.
You can verify that by right clicking and selecting "Stats for nerds" in youtube video:
https://www.youtube.com/watch?v=lOktvP4 ... e=youtu.be
HQ.120fps.yt.jpg
HQ.120fps.yt.jpg
HQ.120fps.yt.jpg (77.86 KiB) Viewed 1590 times

Finally I learned how to use ffmpeg to slowdown all frame timestamps in the .mkv file 4×, and uploading that youtube recognizes the video as 30fps (despite the frameskips). For me that is the best compromise for accuracy in playback, a 4× slowmo:

Code: Select all

🍓 ffmpeg -i tst.mkv -filter:v "setpts=4*PTS" tst.4x.mkv
🍓
https://www.youtube.com/watch?v=hKzVy_L ... e=youtu.be
HQ.120fps.slowmo.yt.jpg
HQ.120fps.slowmo.yt.jpg
HQ.120fps.slowmo.yt.jpg (82.54 KiB) Viewed 1590 times

Summary:
Maximal mode4 framerate that allows for 0 frameskips is 90fps "only".
But conversion of recorded .h264 video with recorded timestamp file to .mkv mitigates that.
Uploading HQ camera 120fps video slowed down 4× as slowmo is best option for me.


P.S:
660fps coin video captured with raspiraw has smaller steps between frames of course:
https://github.com/Hermann-SW/Raspberry ... ster/coins
Image
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

User avatar
jbeale
Posts: 3643
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Raspberry Pi High Quality Camera

Tue May 12, 2020 4:23 am

I'm a bit vague on exactly how resolution is supposed to be measured. However if my assumptions are correct, my reading of a resolution chart indicates a Sigma 70mm Macro (Canon EF mount) lens at f/8 achieves somewhere around 1520 "lines per picture height" (LP/PH) of resolution with the Pi-HQ sensor, near the extinction point where a line-space wedge pattern becomes uniformly grey. For the 4056x3040 image, that may indicate this lens reaches the full 12 Mpixel-ish resolution (at least at near-0 contrast and at center frame). Admittedly this full-frame lens is a little unwieldy for this sensor. Below is a 1:1 crop of a test pattern, 801 x 479 pixels cropped out of the full 4056 x 3040 pixel frame, and also a downsized version of the whole image. The moire patterns on the finer tilted stripe blocks to the right are actually just artifacts from my home printer. The chart is an inkjet print on US letter size paper and 8 m away.
Sigma70mm_lens.jpg
Sigma70mm_lens.jpg (71.45 KiB) Viewed 1503 times
ResPat-1to1-crop.jpg
ResPat-1to1-crop.jpg (125.93 KiB) Viewed 1471 times
Sigma70mm_f8_small.jpg
Sigma70mm_f8_small.jpg (104.7 KiB) Viewed 1381 times
Last edited by jbeale on Tue May 12, 2020 2:50 pm, edited 2 times in total.

pootle
Posts: 374
Joined: Wed Sep 04, 2013 10:20 am
Location: Staffordshire
Contact: Website

Re: Raspberry Pi High Quality Camera with ludicous lens

Tue May 12, 2020 10:05 am

I tried my HQ camera in a pikon, but was somewhat disappointed, so I printed a canon adapter for the camera and tried it with a Canon 70-200 F2.8 L. It is pretty spectacular. The test card I printed on a laser printer A4 sheet (and the source image was a bit flakey), and it is 4m from the camera with the lens at 70mm. It's at an angle 'cos I stuck it on a telescope mount - focusing on a normal camera tripod was challenging!
1:1 crop and downsized of the whole image


I've also tried with an old tamron 300mm F2.8 I have, and apart from needing to put the chart at the far end of the garden, wide open it was soft in comparison and even stopped down to F8, did not really resolve any more detail than the canon lens.
Attachments
test1.jpg
test1.jpg (81.38 KiB) Viewed 1444 times
test3.jpg
test3.jpg (174.94 KiB) Viewed 1444 times

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8688
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Raspberry Pi High Quality Camera

Tue May 12, 2020 3:07 pm

HermannSW wrote:
Mon May 11, 2020 6:42 pm
I tested raspivid with framerate 120fps and new HQ camera, and am a bit disappointed.
<snip>
720p120 is well into the H264 Level 4.2 domain, and the encoder was only designed for level 4.0/4.1 (720p68).
TBH The software features probably haven't been fully exercised for at least a year, and possibly more, so it would have been developed on an overclocked Pi3 which has slightly different bus configurations. That said, seeing as you got frame drops at a lower output resolution, that would imply it is limited by the ISP rather than codec. Pi4 should have an increased clock frequency for the ISP and codec block anyway, so I would have expected it to work.

Another thing to add to the list of things to look at.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
jbeale
Posts: 3643
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Raspberry Pi High Quality Camera

Tue May 12, 2020 3:14 pm

Wow pootle, that is an amazingly sharp image! Congratulations on getting that focused so well. I was trying to use the manual lens focus ring, and found it very difficult to adjust in the small steps required. Maybe it is better to use a macro-style focusing rail setup, even at these long distances (8 m in my case). This points out the kind of extreme measures required to actually make good on the sensor's potential using a longer lens; the depth of field that's truly in focus is just tiny. Motivated by your example I tried my lens wide open at f/2.8, and it showed better sharpness, although a lot more purple flaring also. Your lens is just amazing.

I originally did my test at f/8, based on a review of this lens that claimed it had best sharpness at that aperture. My testing today at f/2.8, f/4 and f/8 shows my sample of the lens really is best wide open at f/2.8. I suspect the reviewer maybe just wasn't doing the focusing with enough precision.
70mmf28-1to1-crop.jpg
70mmf28-1to1-crop.jpg (169.68 KiB) Viewed 1335 times

User avatar
schoolpost
Posts: 32
Joined: Sun Feb 19, 2017 10:47 am
Location: Canada
Contact: Website

Re: Raspberry Pi High Quality Camera

Tue May 12, 2020 6:12 pm

jbeale wrote:
Tue May 12, 2020 3:14 pm
Motivated by your example I tried my lens wide open at f/2.8, and it showed better sharpness, although a lot more purple flaring also. Your lens is just amazing.

I originally did my test at f/8, based on a review of this lens that claimed it had best sharpness at that aperture. My testing today at f/2.8, f/4 and f/8 shows my sample of the lens really is best wide open at f/2.8. I suspect the reviewer maybe just wasn't doing the focusing with enough precision.
You are running up against diffraction limits given the sensor/pixel size at something like F8. On the other hand softness/chromatic abberation can be expected at the fast end of the lens at 2.8.

Something in the middle like F3.5/F4 might be an ok sweet spot.

pootle
Posts: 374
Joined: Wed Sep 04, 2013 10:20 am
Location: Staffordshire
Contact: Website

Re: Raspberry Pi High Quality Camera

Tue May 12, 2020 9:43 pm

jbeale wrote:
Tue May 12, 2020 3:14 pm
Maybe it is better to use a macro-style focusing rail setup, even at these long distances (8 m in my case).
That's a good idea, focusing is pretty difficult, and I tried with a 400m F5.6 prime I have, but gave up because I couldn't reliably get it sharp.

It's that or making a little motor driven focuser.

User avatar
HermannSW
Posts: 2543
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Raspberry Pi High Quality Camera

Tue May 12, 2020 9:57 pm

pootle wrote:
Tue May 12, 2020 9:43 pm
or making a little motor driven focuser.
I did build my own linear actuator with 1mm (only) operational range, but 3µm resolution based on single 28BYJ48 stepper motor (shaft):
https://forum.arduino.cc/index.php?topic=645745.0
Image

I also received 40mm linear cheap actuators, have not used them because playing too much with HQ camera and my raspcatbot:
https://www.aliexpress.com/item/33043028358.html
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

nlapenn
Posts: 3
Joined: Wed May 13, 2020 1:46 am

Re: Raspberry Pi High Quality Camera

Wed May 13, 2020 2:16 am

Looks like there is plenty of room to add a MFT mount on around/on top of the C/CS adapter. Grabbed an existing MFT adapter model and modified it to fit and got pretty good results. A 3d print won't last very long so I ordered the cheapest MFT extension tube I could find and I'll design a better adapter around it when it arrives.

Its late/dark so I took a few quick test shots with a 7Artisans (It is my only fully manual lens). It has a lot of bloom but in better lighting conditions I could stop it down and it would look sharper. I also took 1 quick shot with my 45-150 zoom (using zoom to focus). It looks a bit sharper. I might play around with my non-manual lenses by pre-focusing them on another camera and then moving them over to the HQ cam. They're much sharper lenses than the two I was able to test with tonight and I'm curious if that'll translate to the sensor.

Image

7Artisans Lens:
Image
Image

Panasonic 45-150:
Image

Aydan
Posts: 719
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: Raspberry Pi High Quality Camera

Wed May 13, 2020 2:03 pm

jamesh wrote:
Thu May 07, 2020 12:49 pm
I've just merged a commit in our userland repo for a new option in the raspi apps to help with focusing. Superimposes a FoM window on the display.

https://github.com/raspberrypi/userland/pull/621

So you will need to checkout userland and rebuild to get a new version of raspistill etc. Will be a while before this gets in to apt.

Thanks to Naush for the work!
@James: is the FoM value also available via MMAL (e.g. for the PiCamera library)? it would be nice to have for motorized focus setups.

Regards
Aydan

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26408
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi High Quality Camera

Wed May 13, 2020 2:08 pm

Aydan wrote:
Wed May 13, 2020 2:03 pm
jamesh wrote:
Thu May 07, 2020 12:49 pm
I've just merged a commit in our userland repo for a new option in the raspi apps to help with focusing. Superimposes a FoM window on the display.

https://github.com/raspberrypi/userland/pull/621

So you will need to checkout userland and rebuild to get a new version of raspistill etc. Will be a while before this gets in to apt.

Thanks to Naush for the work!
@James: is the FoM value also available via MMAL (e.g. for the PiCamera library)? it would be nice to have for motorized focus setups.

Regards
Aydan
Of course. It's a new MMAL flag that is passed to the camera control port. Check out the pull request to see what changed.

EDIT: Ah, I see I have misunderstood the question. Please see answers below.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

ethanol100
Posts: 637
Joined: Wed Oct 02, 2013 12:28 pm

Re: Raspberry Pi High Quality Camera

Wed May 13, 2020 2:29 pm

jamesh wrote: Of course. It's a new MMAL flag that is passed to the camera control port. Check out the pull request to see what changed.
But this will only activate the overlay for the preview window, this will not deliver the numbers drawn on it back to raspisitll/vid.
Or did I got this wrong?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8688
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Raspberry Pi High Quality Camera

Wed May 13, 2020 2:39 pm

ethanol100 wrote:
Wed May 13, 2020 2:29 pm
jamesh wrote: Of course. It's a new MMAL flag that is passed to the camera control port. Check out the pull request to see what changed.
But this will only activate the overlay for the preview window, this will not deliver the numbers drawn on it back to raspisitll/vid.
Or did I got this wrong?
Correct, the number isn't delivered back to the app, only scribbled on the images.
(Using libcamera and the vc.ril.isp or V4L2 isp component you do get back the raw FOM statistics)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
HermannSW
Posts: 2543
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Raspberry Pi High Quality Camera

Wed May 13, 2020 2:43 pm

ethanol100 wrote:
Wed May 13, 2020 2:29 pm
But this will only activate the overlay for the preview window, this will not deliver the numbers drawn on it back to raspisitll/vid.
Or did I got this wrong?
Yes, Jamesh confirmed only preview window.
I made FoM available to picamera yesterday (even on two preview windows on two HDMI displays):
viewtopic.php?f=43&t=273804&p=1659688#p1659688
Still investigating whether I can grab one output from splitter and store in a file.
In that case I will be able to modify that code to provide FoM via python streaming webserver for headless PIs.
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

Aydan
Posts: 719
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: Raspberry Pi High Quality Camera

Wed May 13, 2020 5:12 pm

6by9 wrote:
Wed May 13, 2020 2:39 pm
ethanol100 wrote:
Wed May 13, 2020 2:29 pm
jamesh wrote: Of course. It's a new MMAL flag that is passed to the camera control port. Check out the pull request to see what changed.
But this will only activate the overlay for the preview window, this will not deliver the numbers drawn on it back to raspisitll/vid.
Or did I got this wrong?
Correct, the number isn't delivered back to the app, only scribbled on the images.
(Using libcamera and the vc.ril.isp or V4L2 isp component you do get back the raw FOM statistics)
until libcamera becomes official, would it be possible to add this readback to MMAL?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26408
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi High Quality Camera

Wed May 13, 2020 8:06 pm

Aydan wrote:
Wed May 13, 2020 5:12 pm
6by9 wrote:
Wed May 13, 2020 2:39 pm
ethanol100 wrote:
Wed May 13, 2020 2:29 pm

But this will only activate the overlay for the preview window, this will not deliver the numbers drawn on it back to raspisitll/vid.
Or did I got this wrong?
Correct, the number isn't delivered back to the app, only scribbled on the images.
(Using libcamera and the vc.ril.isp or V4L2 isp component you do get back the raw FOM statistics)
until libcamera becomes official, would it be possible to add this readback to MMAL?
libcamera is official. Albeit still under development.

Adding to MMAL would require a not insignificant amount of work, and since we no longer do development work on MMAL (because libcamera), it seems unlikely, but there may be a shortcut somewhere, if there is time to look. Might ask around tomorrow if people think it's an 'easy' thing to add.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8688
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Raspberry Pi High Quality Camera

Wed May 13, 2020 8:17 pm

jamesh wrote:
Wed May 13, 2020 8:06 pm
Aydan wrote:
Wed May 13, 2020 5:12 pm
until libcamera becomes official, would it be possible to add this readback to MMAL?
libcamera is official. Albeit still under development.

Adding to MMAL would require a not insignificant amount of work, and since we no longer do development work on MMAL (because libcamera), it seems unlikely, but there may be a shortcut somewhere, if there is time to look. Might ask around tomorrow if people think it's an 'easy' thing to add.
Yes, Libcamera is officially released.
MMAL is still fully supported, and I suspect it's a relatively easy add. I'll see how tomorrow goes.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
HermannSW
Posts: 2543
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Raspberry Pi High Quality Camera

Wed May 13, 2020 9:13 pm

HermannSW wrote:
Fri May 08, 2020 7:12 am
I tried to use the CS lens I have as "microscope".
...
I have a CS holder I can unscrew from v1 camera with CS lens. More detailed photos can only be achieved with long lightproof lube between imx477 sensor and CS lens, like this M12 lens with tube and CS to M12 adapter from previous posting:
Today 1m 28mm diameter 1.5mm thickness aluminum tube arrived. I did cut 10cm piece from it with metal handsaw, and it was not good first. After some corrections tube looked better, is 9.8cm now. I did superglue CStoC adapter on camera module side, and M12 CS lens holder I unscrewed from another camera I have on the other side. Looks nice:
20200513_223455.15%.jpg
20200513_223455.15%.jpg
20200513_223455.15%.jpg (97.5 KiB) Viewed 1031 times

I did not get any image, so aimed directly into light. It seems that the lens projection does not hit imx477 sensor area, instead a reflection from tube inside. Needs rework:
tst.15%.jpg
tst.15%.jpg
tst.15%.jpg (170.17 KiB) Viewed 1031 times

P.S:
I just verified that indeed the tube is not good, by inserting CStoM12 metal adapter with M12 lens for that I know that with same length M12 tube the lens worked fine. No image to get:
20200514_003011.15%.jpg
20200514_003011.15%.jpg
20200514_003011.15%.jpg (139.8 KiB) Viewed 1005 times
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

Tomgodshalk
Posts: 1
Joined: Wed May 13, 2020 10:42 pm

Re: Raspberry Pi High Quality Camera

Thu May 14, 2020 12:11 pm

Hello- I recently got a HQ module but cannot get my pj to recognize it. Cannot read camera info. Keeping the defaults for 0V5467. Mmal_vc_component_create: failed to create component 'vc.ril.camera' .............failed to create camera component...... and also a line advising to check connections. Things work with older camera modules and I've reseated the ribbon a few times. Perhaps defective module? I'm stuck! Thanks for any help - tom

drich
Posts: 33
Joined: Tue Jul 28, 2015 7:36 pm

Re: Raspberry Pi High Quality Camera

Thu May 14, 2020 2:59 pm

Tomgodshalk wrote:
Thu May 14, 2020 12:11 pm
Hello- I recently got a HQ module but cannot get my pj to recognize it. Cannot read camera info. Keeping the defaults for 0V5467. Mmal_vc_component_create: failed to create component 'vc.ril.camera' .............failed to create camera component...... and also a line advising to check connections. Things work with older camera modules and I've reseated the ribbon a few times. Perhaps defective module? I'm stuck! Thanks for any help - tom
Hello, try to update your firmware with sudo rpi-update
If the problem still persists, I would be curious to know if your camera board gets hot at the center.
Mine had same problem, then came back to life, and now is dead again..

Return to “Camera board”