gopro / labs

GoPro Labs
Apache License 2.0
446 stars 39 forks source link

Inadequate ISO behavior in photo mode and timelapse mode, when LOGB parameter is set #850

Closed sergey-tyrnov closed 2 months ago

sergey-tyrnov commented 3 months ago

If you set any value to LOGB, the photo and time lapse modes become almost impossible to use because of the large amount of noise. Camera - GoPro 12, lab firmware version - v2.20.70, March 2024.

How to reproduce:

  1. Reset all lab settings - !RESET!10
  2. Enable ISO and shutter speed display - !MEXPS=1
  3. Set MIN ISO, MAX ISO settings for video, photo and time lapse modes. For example, everywhere we set min and max equal to 100. Look at the EXPS readings. For video mode - ok, for photo and time lapse the ISO values are higher than ISO MAX (about twice the maximum), which should not be the case. At the same time photo and time lapse modes can be used, visually they look acceptable.
  4. Set LOGB, e.g. like this !MLOGB=400
  5. In photo and time laps modes, the EXPS readings still show ISO above the preset (just like before), but the picture is WAY WORSE. There was a lot of noise, so photo modes are impossible to use. When shooting RAW photos, the RAW comes out clean with no noise, but the JPG is very noisy.
  6. To get rid of the noise, you must execute the !RESET!10 command again
dnewman-gpsw commented 3 months ago
  1. You are looking at the preview settings. Look in the photo metadata.
  2. You should combine with color Flat, otherwise you might have tone-mapping enabled with LOGB.

LOGB does amplify shadow details and noise, that is the natue of log curves. Try with color Flat.

sergey-tyrnov commented 3 months ago

In photo mode I have "Color Profile: Natural" in the settings. The picture in photo mode looks worse than in video mode with similar settings (same white balance, ISO range, shutter speed settings).

Also I tried to put in photo mode "Color Profile: Flat", the situation did not change much, in video mode with "Color Profile: GP-Log" is still cleaner.

If you close the lens so that no light falls on it, then you can estimate the noise level in the shadows. In video mode there is much less noise than in photo mode.

In photo mode, the EXPS shows ISO 1500, with my maximum ISO set to 400. In video mode EXPS works correctly. The exif data of the photo (JPG) shows that the photo was taken at ISO 400, but there is as much noise on the photo as on the camera display.

I realize that Log curve affects JPG photos in photo modes the same way it does on other cameras. But why is the picture significantly noisier than in video mode? They should be the same, but they are not.

sergey-tyrnov commented 3 months ago

I did a few more experiments. Be sure to close the lens to look at the noise level in the shadows.

  1. !MLOGB=1 video mode and photo mode are identical, there is almost no noise in the shadows
  2. !MLOGB=200 video mode and photo mode are similar, but photo mode starts to be noisier.
  3. !MLOGB=400 video mode and photo mode start to differ, photo mode becomes noticeably noisier
  4. !MLOGB=800 in video mode quite clear shadows, but in photo mode you can see solid noise, which starts to give in purple

In photo mode I tried all the color profiles. They affect the picture, but not significantly. The problem with strong noise when using the LOGB curve remains in photo mode.

dnewman-gpsw commented 3 months ago

It might not be fixable, the LOGB hack is really deep, and was designed for video applications, as photos already have the Raw option. What setting are you using for NR01? Really LOGB and NR01 should be used together, I wonder if some of what you are seeing is video noise reduction versus photo noise reduction.

sergey-tyrnov commented 3 months ago

I used different values of NR01: 100, 50, 1. The noise reduction seems to be working as it should. At NR01=1 I can see a fine noise texture. At NR01=100 I can see the noise, but it is more blurred. But the problem that there is much more noise in photo modes still remains.

I agree that I can use RAW in photo mode, but it has limitations in shooting speed, besides it doesn't solve the noise problem in timelapse mode. So the only working solution I can see is to use LOGB=1 if I want to use photo mode or shoot timelapse.

Speaking of which, when GoPro shoots in photo mode it applies the log curve (if LOGB is set), then applies one of the color profiles (Vibrant, Natural, Flat) on top of that, which is not correct. I came to this conclusion because when you change color profiles, the picture changes. It would be logical to disable the selection of these profiles if the LOGB variable is set, just as it is done when shooting in video mode.

I would also like to point out that when just Log mode is used, without setting LOGB via qr code (LOGB has not been set on the camera before or the camera has been reset), then the photo mode is fine, even with Log. Problems start only when LOGB is initialized via qr code.

dnewman-gpsw commented 3 months ago

Vibrant, Natural, Flat change tone mapping rules, not the curve. Only flat should turn off the tone mapping. I don't believe the luts are doubly applied, but you can't conclude from the look difference that the curves are different, when the tone mapping's different. The question is, is the transfer function of photo flat the same as the transfer function in video flat with the same log base? Do they look the same? The curve, not the noise. Also you should be using photo type Standard in all your testing as photo HDR and Superphoto are doing multiple exposure compositing, very likely messed up by LOGB.

sergey-tyrnov commented 2 months ago

All photos and videos were taken with the following lab settings:

!MBITR=150 !MNR01=1 !MTONE=3 !MLOGB=800,15

But I want to say that to reproduce exactly the same effect it is enough to set LOGB variable to some value. I have done a lot of tests, the problem is exactly in LOGB. The bigger the value, the better the difference will be seen, for example on values of 800 or 1000 the difference is striking.

Maybe there is a possibility to set LOGB for video and photo modes separately? Now it turns out that if the variable LOGB is set, then the camera cannot be fully used. Before shooting timewarp, timelapse or photo it is necessary to set LOGB=1, and for this I constantly need a phone with qr codes.

But if it is possible to make the picture the same in photo mode and video mode, this would also be acceptable.

4 5 1 2 3

dnewman-gpsw commented 2 months ago

As soon a I press shutter the ISO on the LCD corrects, the preview (before capture) does not honor the ISO limits in all scenarios. This is not a Labs thing, base camera behavior.

I'm not get ths same results. This is ISO Max 800, ISO Min 100, NR01=1, LOGB=1000 for video and photo. The photo is slightly cleaner, as photo modes use a slower (high quality) readout from the sensor, but otherwise there are very close to the same transfer function.

Combined

sergey-tyrnov commented 2 months ago

I was wondering why we got different results. I decided to reset the camera completely. First I did the "!RESET!10" command, then I did a "Factory Reset". The camera was completely reset to factory settings. I set the photo and video modes as normal. Took test shots and they were indeed very similar. But then I noticed that there was no "GP-Log" in the video. Then I went to the settings and found that I had the 8bit setting. After I set it to 10bit, the photo mode problems reappeared.

I will describe the full sequence how to reproduce this bug:

  1. !RESET!10
  2. Preferences->Reset->Factory Reset
  3. Setup: LANGUAGE->English. Agree. Off. Pair BT
  4. Scan QR codes: !MWIDE=1 !MBITR=150 !MLEVL=9 !MNR01=1 !MEXPS=1 !MTONE=3 !MTUSB=1 !MLOGB=800,15
  5. ORIENTATION. LOCKED. CONTROLS PRO
  6. Customize Video Mode: Standard, 8:7, 5.3K, 30fps, HyperSmooth:Off, WB:5500K, ISOMax:800, Sharpness:Low,Color:Flat
  7. Customize Photo Mode: Output:RAW,White Balance:5500K,ISO Max:800,Sharpness:Low,Color:Flat
  8. Reboot GoPro
  9. Take test photos and videos. They turn out very similar
  10. Go to: Preferences->Video->Bit Rate->High Preferences->Video->Bit Depth->10-Bit
  11. Reboot GoPro
  12. Customize Video Mode: Profile:Log, 8:7, 5.3K, 30fps, HyperSmooth:Off, WB:5500K, ISO Max:800
  13. Reboot GoPro
  14. Taking test photos and videos. Get different shots, same as I showed earlier.
dnewman-gpsw commented 2 months ago

I was in 10-bit for my above examples. Stop using !MTONE=3, you should need that when using Flat. Also stop using the black level offset, there is no good reason for it. Just use LOGB=800

So I scanned this single code: $WIDE=1$BITR=150$LEVL=9$NR01=1$EXPS=1$TUSB=1$LOGB=800mVd1b1cFw55x0sLi8M1!S!1E!1NmPw55cFsLi8M1x0r!S

This command, set up the camera and take the video and photo. image

Still all works fine here.

sergey-tyrnov commented 2 months ago

I applied the QR code and nothing changed, but then I changed the 10bit to 8bit and set the 10bit again and everything was fine. So the problem was in the settings that I set incorrectly. Thank you very much for your help and patience!

dnewman-gpsw commented 2 months ago

Excellent. Closing out this issue.