Problème dans le script "preview_drm.py" #679
Replies: 13 comments
-
Have you quit or suspended X-Windows? |
Beta Was this translation helpful? Give feedback.
-
Can you tell me how to quit x-windows ?
I use a Raspberry Pi OS with desktop (bullseye)
Thanks in advance
Adrien
Le jeu. 20 avr. 2023, 16:59, davidplowman ***@***.***> a
écrit :
… Have you quit or suspended X-Windows?
—
Reply to this email directly, view it on GitHub
<#679 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYJE6FRNWHQ2T2MW3LD43OLXCFFODANCNFSM6AAAAAAXFRTQII>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
You could either boot to the command line and not the desktop. To do that, open the Raspberry Pi Configuration tool from the Preferences menu and for "Boot:" select "To CLI". Or you can simply suspend X-Windows using Ctrl-Alt-F1. To go back again, it's normally Ctrl-Alt-F7. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for you quick answer. I will try tomorrow.
Adrien
Le jeu. 20 avr. 2023, 17:34, davidplowman ***@***.***> a
écrit :
… You could either boot to the command line and not the desktop. To do that,
open the Raspberry Pi Configuration tool from the Preferences menu and for
"Boot:" select "To CLI".
Or you can simply suspend X-Windows using Ctrl-Alt-F1. To go back again,
it's normally Ctrl-Alt-F7.
—
Reply to this email directly, view it on GitHub
<#679 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYJE6FXSEDQN2CD5ELXCCFLXCFJORANCNFSM6AAAAAAXFRTQII>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I tried your solution and it's working, thank you. The preview don't fit
correctly my screen 1920x1080 pixels and the picture it's not in the full
resolution. Do you know how to configure the piCamera2 to have the preview
on the full screen and taking a picture with the full resolution of the
camera ?
Thanks in advance
Adrien
Le jeu. 20 avr. 2023, 18:39, Adrien Masson ***@***.***> a écrit :
… Thank you very much for you quick answer. I will try tomorrow.
Adrien
Le jeu. 20 avr. 2023, 17:34, davidplowman ***@***.***> a
écrit :
> You could either boot to the command line and not the desktop. To do
> that, open the Raspberry Pi Configuration tool from the Preferences menu
> and for "Boot:" select "To CLI".
>
> Or you can simply suspend X-Windows using Ctrl-Alt-F1. To go back again,
> it's normally Ctrl-Alt-F7.
>
> —
> Reply to this email directly, view it on GitHub
> <#679 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AYJE6FXSEDQN2CD5ELXCCFLXCFJORANCNFSM6AAAAAAXFRTQII>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
Hi, are you still asking about the DRM preview? Then something like this should work:
To take a full resolution capture, use
If it fails to allocate buffers then you may need to increase the amount of available CMA memory (section 8.3 of the manual). |
Beta Was this translation helpful? Give feedback.
-
Hi,
Thank you very much for your answer everything fit correctly now. But the
problem I got again sorry, it's about the quality of the camera. I used the
pi camera v2 before with the librairie Picamera and I got better quality
than the pi camera v3. Would you know why ?
Thanks in advance
Adrien
Le lun. 24 avr. 2023, 11:08, davidplowman ***@***.***> a
écrit :
… Hi, are you still asking about the DRM preview? Then something like this
should work:
from picamera2 import Picamera2, Preview
picam2 = Picamera2()
picam2.start_preview(Preview.DRM, x=0, y=0, width=1920, height=1080)
preview_config = picam2.create_preview_configuration({"size": (1920, 1080)})
picam2.configure(preview_config)
picam2.start()
To take a full resolution capture, use
capture_config = picam2.create_still_configuration()
picam2.switch_mode_and_capture_file(capture_config, "test.jpg")
If it fails to allocate buffers then you may need to increase the amount
of available CMA memory (section 8.3 of the manual
<https://datasheets.raspberrypi.com/camera/picamera2-manual.pdf>).
—
Reply to this email directly, view it on GitHub
<#679 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYJE6FUSRITBPND666ZPE5DXCY7HXANCNFSM6AAAAAAXFRTQII>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Can you say in what way the quality is bad? With the v3 camera don't forget to start the autofocus, for example:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer. I already used this command line in my python
script but some time the picture is not very clear. I believed the quality
would be better. I don't know if a got a hardware problem. Maybe the focus
not working properly unfortunately.
Le mar. 25 avr. 2023, 13:20, davidplowman ***@***.***> a
écrit :
… Can you say in what way the quality is bad? With the v3 camera don't
forget to start the autofocus, for example:
from libcamera import controls
# ...
picam2.set_controls({'AfMode': controls.AfModeEnum.Continuous})
—
Reply to this email directly, view it on GitHub
<#679 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYJE6FQIYTCCSRDE5DGRCX3XC6XPNANCNFSM6AAAAAAXFRTQII>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Maybe try setting the lens manually to different positions and see if there is any change in the focal position, for example:
(Don't set the |
Beta Was this translation helpful? Give feedback.
-
Hello, thank you for your answer. I did a lot of tests and the result is
very bad...
I'm using this script :
#!/usr/bin/python3
# Capture a JPEG while still running in the preview mode.
import time
from picamera2 import Picamera2, Preview
from libcamera import controls
from libcamera import Transform
picam2 = Picamera2()
picam2.options['quality'] = 95
picam2.set_controls({"AfMode": controls.AfModeEnum.Continuous})
capture_config = picam2.create_still_configuration()
picam2.start_preview(Preview.DRM,x=0, y=0, width=1280, height=1024,
transform=Transform(hflip=1))
preview_config = picam2.create_preview_configuration({"size": (1280, 1024)})
picam2.configure(preview_config)
picam2.start()
time.sleep(2)
picam2.switch_mode_and_capture_file(capture_config, "test_full.jpg")
The quality is still bad even if I try to set the focus manually. I'm very
lost and I don't know if the camera is like this or if i got a hardware
problem on my pi camera v3.
You will find as an attachment some pictures I took with this script. You
will also find a picture capture from my pi Camera v2 in the same
conditions.
I tried few things :
- Setting the focus manually : picam2.set_controls({'LensPosition': 0})
- Setting quality : picam2.options['quality'] = 95
- Setting focus : picam2.set_controls({"AfMode":
controls.AfModeEnum.Continuous, "AfSpeed": controls.AfSpeedEnum.Fast})
- Changing preview mode : DRM, QTGL
Can you tell if your pictures are better ?
Thank in advance,
Adrien
Le mer. 26 avr. 2023 à 10:34, davidplowman ***@***.***> a
écrit :
… Maybe try setting the lens manually to different positions and see if
there is any change in the focal position, for example:
picam2.set_controls({'LensPosition': 0}) # focus at infinity
picam2.set_controls({'LensPosition': 10}) # focus at ~10cm
(Don't set the 'AfMode' before trying these commands, it should be set to
manual mode when you start Picamera2). Including a link to a test image
that shows the image quality problems may also be helpful. Thanks!
—
Reply to this email directly, view it on GitHub
<#679 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYJE6FXMBKZ6RNMU6XKBUBLXDDMZVANCNFSM6AAAAAAXFRTQII>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
You will find below the link to the picture i took with my pi camera v2 in
the same conditions (too big to send by email). The quality is better and
the size of the file is bigger. Maybe that's why the quality is better. I
used the library Picamera to use my pi camera v2.
https://drive.google.com/file/d/1ZWuukda-bDebDxKuJxOwZfKrsQUskvUn/view?usp=share_link
Thanks
Adrien
Le mer. 26 avr. 2023 à 10:34, davidplowman ***@***.***> a
écrit :
… Maybe try setting the lens manually to different positions and see if
there is any change in the focal position, for example:
picam2.set_controls({'LensPosition': 0}) # focus at infinity
picam2.set_controls({'LensPosition': 10}) # focus at ~10cm
(Don't set the 'AfMode' before trying these commands, it should be set to
manual mode when you start Picamera2). Including a link to a test image
that shows the image quality problems may also be helpful. Thanks!
—
Reply to this email directly, view it on GitHub
<#679 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYJE6FXMBKZ6RNMU6XKBUBLXDDMZVANCNFSM6AAAAAAXFRTQII>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for posting the v2 picture, it looks like I would expect. Can you post one of the v3 camera pictures? The script you have looks fine, so I'm still not really understanding what is wrong with your images. v3 camera images should look better than v2 images - they are slightly higher resolution and normally would have slightly lower noise and slightly better detail (though very fine texture patterns can sometimes cause some aliasing problems). When you set the lens position manually (for example from 0 to 10 and back) do you actually see the image changing? If you could post some images, that would be helpful. Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Bonjour,
Je viens de lancer votre script d'exemple "preview_drm.py" mais j'obtiens l'erreur suivante:
La camera ne se lance pas du tout. Pouvez-vous me donner un petit coup de pouce ?
Merci d'avance,
Adrien
Beta Was this translation helpful? Give feedback.
All reactions