Successfull ASI178MM headless PI4 Streaming Project but small API bug ?

any question related to our SDK and driver

Moderators: yang, Support@ZWO

Post Reply
Serveurperso
Posts: 4
Joined: Sat Jul 04, 2020 11:01 am

Successfull ASI178MM headless PI4 Streaming Project but small API bug ?

Post by Serveurperso » Thu Jul 09, 2020 12:53 pm

Hi !

I'm a French ASI178MM user, I managed to stream live @ 30FPS low latency the ZWO camera I like on a live robotics teleoperation website (https://www.vigibot.com click on the robot icon named "Wow").

I use a Raspberry PI 4 4Go HEADLESS and C++ / OpenCV you can see the result on the video where I show a Dark calibration process and live float stack, every time working smooth @ 30FPS. you can look the small demo here : https://www.youtube.com/watch?v=X7wojpTc0n4 where I push the IMX178 @ maximum gain and stacking to show hot pixel visible and the stack/dark calibration algorithm.

The objective is to make a small (and public) remote sky observatory @ countryside (because I live in Paris... For the first test I use a 50mm F1.1 photo fast lens)

I found a strange bug inside the API;
I use HARDWARE binning to get faster FPS on the PI 4, it's important for the comfort of live moving inside the sky;
Also hardware vs software binning don't give a visible performance difference in term of quality, especialy for the live sky viewer I want to create;
Software binning give too bad performance on PI 4 (low FPS video, or good for HD pictures). So, I love the Bin4 for live low latency preview usage;

Some time on a process launch, I get incorrect brightness/offset. The problem is :

ASISetControlValue(id, ASI_HARDWARE_BIN, true, ASI_FALSE);

I try to launch this API function every 10 secondes inside the video capture loop only to reproduce the bug, and about 2 time on 8, the function setup the camera with an incorrectly high brightness.

My complete source code is here, it's small but I can remove the Vigibot.com Frame to reduce the problem if you need it.
https://www.serveurperso.com/temp/zwo/capture.cpp

I use OpenCV convertTo to move brighness (beta +/- 200000) and contrast (alpha +/- 200), it's the only way to show the problem because it's a problem about few % brighness error.

Can you help me ? I make more code and demo if required.

Pascal

Tech@ZWO
Posts: 134
Joined: Mon Nov 26, 2018 9:59 am

Re: Successfull ASI178MM headless PI4 Streaming Project but small API bug ?

Post by Tech@ZWO » Thu Jul 23, 2020 10:34 am

Hi

We will try to test on your demo

yang
Site Admin
Posts: 227
Joined: Fri Jul 25, 2014 2:43 am

Re: Successfull ASI178MM headless PI4 Streaming Project but small API bug ?

Post by yang » Fri Jul 24, 2020 10:09 am

I try your capture.cpp and it runs normally, but I wonder how to show the bug?
ZWO software engineer
Location:lon=120.6 lat=31.3
SuZhou China

Serveurperso
Posts: 4
Joined: Sat Jul 04, 2020 11:01 am

Re: Successfull ASI178MM headless PI4 Streaming Project but small API bug ?

Post by Serveurperso » Tue Aug 04, 2020 9:36 am

Hello,

Sorry I waited your answer to make you a more standalone dedicated code showing the bug. I think you still managed to get a similar code to work.

This is a random bug where you need to exit and launch the process.
You need a small video process like the one I made, with : hardware binning enabled (bin4) + 16 bits enabled.
I think there is a offset calculation random problem inside the API ?

I added an automatic rescale inside the last code that hide the problem...
I must check if the bug is on other camera I buy soon.

Thanks

Post Reply