question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bcon mipi daA2500-60mci not up to true fps

See original GitHub issue

Hi I have a bcon mipi daA2500-60mci running on Jetson Nano. Per spec, this camera should have up to 60fps. But I couldn’t find a way to get it more than 10fps. I tried to set exposure time to min, turn off exposure auto. But the fps still did not improve. What did I do wrong?

This is the code the I use to display with OpenCV 3.4.11

from pypylon import pylon
import time
import cv2

# conecting to the first available camera
camera = pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice())
camera.Open()

#camera.Gain = camera.Gain.Max
#camera.ExposureTime.SetValue(camera.ExposureTime.Min)

camera.ExposureAuto.SetValue("Off")

# Grabing Continusely (video) with minimal delay
camera.StartGrabbing(pylon.GrabStrategy_LatestImageOnly)
converter = pylon.ImageFormatConverter()

# converting to opencv bgr format
converter.OutputPixelFormat = pylon.PixelType_BGR8packed
converter.OutputBitAlignment = pylon.OutputBitAlignment_MsbAligned
start = time.time()
counter = 0
while camera.IsGrabbing():
    grabResult: pylon.GrabResult = camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException)

    if grabResult.GrabSucceeded():
        # Access the image data
        image = converter.Convert(grabResult)
        img = image.GetArray()
        counter += 1
        elapsed = time.time() - start
        cv2.putText(img, "{} FPS".format(int(counter / elapsed)), (200, 20),
                    cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255), 2)
        cv2.imshow('title', img)
        k = cv2.waitKey(1)
        if k == 27:
            break
    grabResult.Release()

# Releasing the resource
camera.StopGrabbing()
camera.close()

cv2.destroyAllWindows()

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
FrankKarstenscommented, Dec 11, 2020
from pypylon import pylon
import time
import cv2

# conecting to the first available camera
camera = pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice())
camera.Open()

#camera.Gain = camera.Gain.Max
#camera.ExposureTime.SetValue(camera.ExposureTime.Min)

camera.ExposureAuto.SetValue("Off")
camera.ExposureTime.SetValue (20000)

# Grabing Continusely (video) with minimal delay
camera.StartGrabbing(pylon.GrabStrategy_LatestImageOnly)
converter = pylon.ImageFormatConverter()

# converting to opencv bgr format
converter.OutputPixelFormat = pylon.PixelType_BGR8packed
converter.OutputBitAlignment = pylon.OutputBitAlignment_MsbAligned
start = time.time()
counter = 0

# use OpenGL for image display if your opencv build supports OpenGL
#cv2.namedWindow('mipi test', cv2.WINDOW_NORMAL|cv2.WINDOW_OPENGL)

# otherwise just use CPU
cv2.namedWindow('mipi test', cv2.WINDOW_NORMAL)
cv2.resizeWindow('mipi test', 1200, 800)

while camera.IsGrabbing():
    grabResult: pylon.GrabResult = camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException)

    if grabResult.GrabSucceeded():

        # Access the image data and convert with pypylon methods
        # image = converter.Convert(grabResult)
        # img = image.GetArray()
        
        # or alternatively convert with opencv methods
        img = cv2.cvtColor( grabResult.GetArray() , cv2.COLOR_YUV2BGR_UYVY)
        
        counter += 1
        elapsed = time.time() - start
        cv2.putText(img, "{} FPS".format(int(counter / elapsed)), (200, 20),
                    cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255), 2)
        
        
        cv2.imshow('mipi test', img, )
        k = cv2.waitKey(1)
        if k == 27:
            break
    grabResult.Release()

# Releasing the resource
camera.StopGrabbing()
camera.close()

cv2.destroyAllWindows()
1reaction
FrankKarstenscommented, Dec 11, 2020

It is the displaying of the image and the high CPU load in the grab loop which slows down your whole application. You should use a named window and should reduce the display area. here’s a proposal:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Acquisition Frame Rate (BCON for MIPI) | Basler
The Acquisition Frame Rate camera feature allows you to set an upper limit for the camera's frame rate.
Read more >
How do you set the fps to 60 for the coral mipi camera
60 FPS not supported. Please see the supported formats below. mendel@tuned-rabbit:~$ v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT ...
Read more >
True FPS in Blueprints - UE Marketplace - Unreal Engine
It is entirely replicated and has many features. Not For Sale. Supported Platforms. Supported Engine Versions. 4.26 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found