Git Product home page Git Product logo

Comments (11)

davidplowman avatar davidplowman commented on June 12, 2024 1

You should be able to use the standard ov5647.json - all you need is the correct black level and reasonable exposure, which you should get. All the other stuff (to do with colours, lens shading etc.) has no effect on the DNG file.

from libcamera.

naushir avatar naushir commented on June 12, 2024

@davidplowman I seem to recall this may be due to an older version of OpenCV install. Do you remember any details about this?

from libcamera.

davidplowman avatar davidplowman commented on June 12, 2024

Hmm, I have to say I don't think I've seen that before.

@twarid I thought maybe it was falling over because there appears to be only a single non-ALSC file, but that seemed to work OK for me.

Can I assume you've downloaded the latest version of all the software? It seems to be that call to np.polyfit that's going wrong, would you be able to print out the input arguments just beforehand (rbs_hat[0] and rbs_hat[1])? Maybe also double-check your numpy version - mine claims to be 1.24.2.

from libcamera.

tewarid avatar tewarid commented on June 12, 2024

I think I've got the latest version of most packages - I did the following and don't see anything significant to update

$ sudo apt update
...
$ apt list --upgradable
Listing... Done
linux-libc-dev/stable 1:1.20230317-1 arm64 [upgradable from: 1:1.20230306-1]
raspberrypi-bootloader/stable 1:1.20230317-1 arm64 [upgradable from: 1:1.20230306-1]
raspberrypi-kernel-headers/stable 1:1.20230317-1 arm64 [upgradable from: 1:1.20230306-1]
raspberrypi-kernel/stable 1:1.20230317-1 arm64 [upgradable from: 1:1.20230306-1]
vcdbg/stable 1:1.20230317-1 armhf [upgradable from: 1:1.20230306-1]
xserver-common/stable,stable 2:1.20.11-1+rpt2+deb11u5 all [upgradable from: 2:1.20.11-1+rpt1+deb11u5]
xserver-xorg-core/stable 2:1.20.11-1+rpt2+deb11u5 arm64 [upgradable from: 2:1.20.11-1+rpt1+deb11u5]
xwayland/stable 2:1.20.11-1+rpt2+deb11u5 arm64 [upgradable from: 2:1.20.11-1+rpt1+deb11u5]

Curiously, numpy version listed here is 1.19.5

$ apt info python3-numpy
Package: python3-numpy
Version: 1:1.19.5-1

Maybe I should try to getting numpy using pip3 instead?

from libcamera.

tewarid avatar tewarid commented on June 12, 2024

Got numpy 1.24.2 using pip3 and got further along.

Now, I get the following error - which can perhaps be explained by not having sufficient input images? Printed out rbs_hat[0] and rbs_hat[1] and they're NaN.

Starting AWB calibration
(nan,)
(nan,)
 ** On entry to DLASCL parameter number  4 had an illegal value
Traceback (most recent call last):
  File "/home/dkt/ctt/../libcamera/utils/raspberrypi/ctt/ctt.py", line 837, in <module>
    run_ctt(json_output, directory, config, log_output)
  File "/home/dkt/ctt/../libcamera/utils/raspberrypi/ctt/ctt.py", line 801, in run_ctt
    Cam.awb_cal(greyworld, do_alsc_colour)
  File "/home/dkt/ctt/../libcamera/utils/raspberrypi/ctt/ctt.py", line 309, in awb_cal
    awb_out = awb(self, cal_cr_list, cal_cb_list, plot)
  File "/home/dkt/libcamera/utils/raspberrypi/ctt/ctt_awb.py", line 97, in awb
    a, b, c = np.polyfit(rbs_hat[0], rbs_hat[1], 2)
  File "<__array_function__ internals>", line 200, in polyfit
  File "/home/dkt/.local/lib/python3.9/site-packages/numpy/lib/polynomial.py", line 668, in polyfit
    c, resids, rank, s = lstsq(lhs, rhs, rcond)
  File "<__array_function__ internals>", line 200, in lstsq
  File "/home/dkt/.local/lib/python3.9/site-packages/numpy/linalg/linalg.py", line 2285, in lstsq
    x, resids, rank, s = gufunc(a, b, rcond, signature=signature, extobj=extobj)
  File "/home/dkt/.local/lib/python3.9/site-packages/numpy/linalg/linalg.py", line 101, in _raise_linalgerror_lstsq
    raise LinAlgError("SVD did not converge in Linear Least Squares")
numpy.linalg.LinAlgError: SVD did not converge in Linear Least Squares

from libcamera.

davidplowman avatar davidplowman commented on June 12, 2024

Those NaNs are definitely still wrong. When I run it (even with a single non-ALSC file), I have proper numbers there. Though note that ultimately you probably will need more than one image (even though it doesn't seem like the actual problem).

So I guess we need to find out why that 6150K_130l.dng file is causing trouble. Would you be able to post a link so that I can download it and try it? Thanks.

from libcamera.

tewarid avatar tewarid commented on June 12, 2024

Sure 6150K_130l.zip. Thanks!

from libcamera.

davidplowman avatar davidplowman commented on June 12, 2024

Can you say anything about how you got that DNG file? It's claiming a black level of 64 which is incorrect for the ov5647. It should have a black level of 16 (out of the full 10-bit range). Let's start by trying to fix that and see if things improve. Thanks!

from libcamera.

tewarid avatar tewarid commented on June 12, 2024

I used uncalibrated.json config to capture the dng e.g. libcamera-still --verbose --tuning-file /usr/share/libcamera/ipa/raspberrypi/uncalibrated.json --mode 2592:1944:10 --raw -o 6150K_130l.dng.

That config specifies a black level of 4096. Which I think is correct for a value of 16 for a 10-bit value scaled up to 16-bit?

from libcamera.

tewarid avatar tewarid commented on June 12, 2024

My bad - I should be using 1024. I will try with that.

from libcamera.

tewarid avatar tewarid commented on June 12, 2024

That did it! Thanks!

from libcamera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.