How can I live stream in HDR using a Picamera Module 3 Noir and a Raspberry Pi 4? (using flask)

I am very new to all this. Currently i am working on a project where i am using the picamera module 3 noir and pi4 for live detection. Due to using the OS Lite version i use flask to stream in on my web browser. I have read through the picamera library etc and know that not every mode of hdr is supported by the pi4, but when i take a picture using the command line (for exmaple. libcamera-still –sharpness 16 -o afbeelding.jpg and libcamera-still –hdr -o afbeelding.jpg) i actually see the difference. The problem is that i am unable to implement this in my code to. I tried the code here below and kept getting this error

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>[0:10:50.706450812] [1573] INFO Camera camera_manager.cpp:316 libcamera v0.3.1+50-69a894c4
[0:10:50.817547227] [1598] WARN RPiSdn sdn.cpp:40 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[0:10:50.819665881] [1598] INFO RPI vc4.cpp:447 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media2 and ISP device /dev/media0
[0:10:50.819791042] [1598] INFO RPI pipeline_base.cpp:1125 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
Traceback (most recent call last):
File "/home/Jadepi/livedetectie/livedetectie1/noircam/hdfoto.py", line 15, in <module>
picam2.set_controls({
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 1234, in set_controls
self.controls.set_controls(controls)
File "/usr/lib/python3/dist-packages/picamera2/controls.py", line 58, in set_controls
self.__setattr__(k, v)
File "/usr/lib/python3/dist-packages/picamera2/controls.py", line 33, in __setattr__
raise RuntimeError(f"Control {name} is not advertised by libcamera")
RuntimeError: Control ScalerSharpen is not advertised by libcamera
</code>
<code>[0:10:50.706450812] [1573] INFO Camera camera_manager.cpp:316 libcamera v0.3.1+50-69a894c4 [0:10:50.817547227] [1598] WARN RPiSdn sdn.cpp:40 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise [0:10:50.819665881] [1598] INFO RPI vc4.cpp:447 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media2 and ISP device /dev/media0 [0:10:50.819791042] [1598] INFO RPI pipeline_base.cpp:1125 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml' Traceback (most recent call last): File "/home/Jadepi/livedetectie/livedetectie1/noircam/hdfoto.py", line 15, in <module> picam2.set_controls({ File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 1234, in set_controls self.controls.set_controls(controls) File "/usr/lib/python3/dist-packages/picamera2/controls.py", line 58, in set_controls self.__setattr__(k, v) File "/usr/lib/python3/dist-packages/picamera2/controls.py", line 33, in __setattr__ raise RuntimeError(f"Control {name} is not advertised by libcamera") RuntimeError: Control ScalerSharpen is not advertised by libcamera </code>
[0:10:50.706450812] [1573]  INFO Camera camera_manager.cpp:316 libcamera v0.3.1+50-69a894c4
[0:10:50.817547227] [1598]  WARN RPiSdn sdn.cpp:40 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[0:10:50.819665881] [1598]  INFO RPI vc4.cpp:447 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media2 and ISP device /dev/media0
[0:10:50.819791042] [1598]  INFO RPI pipeline_base.cpp:1125 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
Traceback (most recent call last):
  File "/home/Jadepi/livedetectie/livedetectie1/noircam/hdfoto.py", line 15, in <module>
    picam2.set_controls({
  File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 1234, in set_controls
    self.controls.set_controls(controls)
  File "/usr/lib/python3/dist-packages/picamera2/controls.py", line 58, in set_controls
    self.__setattr__(k, v)
  File "/usr/lib/python3/dist-packages/picamera2/controls.py", line 33, in __setattr__
    raise RuntimeError(f"Control {name} is not advertised by libcamera")
RuntimeError: Control ScalerSharpen is not advertised by libcamera
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>from picamera2 import Picamera2
from time import sleep, strftime
# Maak een Picamera2-object
picam2 = Picamera2()
# Configureer de camera voor HDR-achtige effecten
camera_config = picam2.create_still_configuration()
# Stel de sluitertijd (shutter) en andere HDR-achtige instellingen in
shutter_speed = 1000000 # Sluitertijd in microseconden (hier 20ms)
iso_value = 100 # ISO waare voor een lagere gevoeligheid
# Stel de camera instellingen in zonder gebruik van 'draft'
picam2.set_controls({
"ExposureTime": shutter_speed, # Stel de sluitertijd in
"AnalogueGain": 1.0, # Verminder de versterking (laagste waarde)
# NoiseReductionMode kan worden ingesteld als je versie van libcamera het ondersteunt
"ScalerSharpen": 16, # Je kunt dit controleren of het werkt in jouw versie
"AeEnable": True # Handmatige belichtingsregeling uitschakelen (om sluitertijd te gebruiken)
})
picam2.configure(camera_config)
# Start de camera
picam2.start()
# Wacht even om de camera op te laten starten
sleep(2)
# Verkrijg de huidige tijd in een geschikt formaat voor de bestandsnaam
current_time = strftime("%Y-%m-%d_%H-%M-%S")
file_name = f"foto_{current_time}.jpg"
# Maak een foto en sla deze op met de tijd als naam
picam2.capture_file(file_name)
# Stop de camera
picam2.stop()
print(f"Foto gemaakt en opgeslagen als '{file_name}'")
</code>
<code>from picamera2 import Picamera2 from time import sleep, strftime # Maak een Picamera2-object picam2 = Picamera2() # Configureer de camera voor HDR-achtige effecten camera_config = picam2.create_still_configuration() # Stel de sluitertijd (shutter) en andere HDR-achtige instellingen in shutter_speed = 1000000 # Sluitertijd in microseconden (hier 20ms) iso_value = 100 # ISO waare voor een lagere gevoeligheid # Stel de camera instellingen in zonder gebruik van 'draft' picam2.set_controls({ "ExposureTime": shutter_speed, # Stel de sluitertijd in "AnalogueGain": 1.0, # Verminder de versterking (laagste waarde) # NoiseReductionMode kan worden ingesteld als je versie van libcamera het ondersteunt "ScalerSharpen": 16, # Je kunt dit controleren of het werkt in jouw versie "AeEnable": True # Handmatige belichtingsregeling uitschakelen (om sluitertijd te gebruiken) }) picam2.configure(camera_config) # Start de camera picam2.start() # Wacht even om de camera op te laten starten sleep(2) # Verkrijg de huidige tijd in een geschikt formaat voor de bestandsnaam current_time = strftime("%Y-%m-%d_%H-%M-%S") file_name = f"foto_{current_time}.jpg" # Maak een foto en sla deze op met de tijd als naam picam2.capture_file(file_name) # Stop de camera picam2.stop() print(f"Foto gemaakt en opgeslagen als '{file_name}'") </code>
from picamera2 import Picamera2
from time import sleep, strftime

# Maak een Picamera2-object
picam2 = Picamera2()

# Configureer de camera voor HDR-achtige effecten
camera_config = picam2.create_still_configuration()

# Stel de sluitertijd (shutter) en andere HDR-achtige instellingen in
shutter_speed = 1000000  # Sluitertijd in microseconden (hier 20ms)
iso_value = 100        # ISO waare voor een lagere gevoeligheid

# Stel de camera instellingen in zonder gebruik van 'draft'
picam2.set_controls({
    "ExposureTime": shutter_speed,  # Stel de sluitertijd in
    "AnalogueGain": 1.0,            # Verminder de versterking (laagste waarde)
    # NoiseReductionMode kan worden ingesteld als je versie van libcamera het ondersteunt
    "ScalerSharpen": 16,     # Je kunt dit controleren of het werkt in jouw versie
    "AeEnable": True               # Handmatige belichtingsregeling uitschakelen (om sluitertijd te gebruiken)
})

picam2.configure(camera_config)

# Start de camera
picam2.start()

# Wacht even om de camera op te laten starten
sleep(2)

# Verkrijg de huidige tijd in een geschikt formaat voor de bestandsnaam
current_time = strftime("%Y-%m-%d_%H-%M-%S")
file_name = f"foto_{current_time}.jpg"

# Maak een foto en sla deze op met de tijd als naam
picam2.capture_file(file_name)

# Stop de camera
picam2.stop()

print(f"Foto gemaakt en opgeslagen als '{file_name}'")

New contributor

ChuchuuXD is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật