genx320_histogram_mode_calibration.py

# هذا العمل مرخص بموجب ترخيص MIT.
# حقوق النشر (c) 2013-2024 OpenMV LLC. جميع الحقوق محفوظة.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# يوضح هذا المثال معايرة البكسلات الساخنة (hot pixel)
# باستخدام كاميرا الأحداث genx320 من شركة Prophesee.

import csi
import time

csi0 = csi.CSI(cid=csi.GENX320)
csi0.reset()
csi0.pixformat(csi.GRAYSCALE)
csi0.framesize((320, 320))
csi0.brightness(128)  # اتركها عند 128 عمومًا (هذه هي القيمة الافتراضية).
csi0.contrast(16)  # زدها لجعل الصورة أكثر وضوحًا.

# معدل الإطارات الافتراضي هو 50 FPS. يمكنك تغييره بين ~20 FPS و~350 FPS.
csi0.framerate(50)

# عرض الصورة غير المعايرة أولاً.
csi0.snapshot(time=5000)

CAL_EVENT_COUNT = 10000  # عدد الأحداث المراد جمعها للمعايرة.
CAL_SIGMA = 0.5  # الانحراف المعياري لاكتشاف البكسلات الساخنة.
disabled_pixels = csi0.ioctl(csi.IOCTL_GENX320_CALIBRATE, CAL_EVENT_COUNT, CAL_SIGMA)
print(f'Disabled {disabled_pixels} hot pixels.')

clock = time.clock()

while True:
    clock.tick()

    img = csi0.snapshot()
    # img.median(1) # تنظيف الضوضاء.

    print(clock.fps())

results matching ""

    No results matching ""