OpenCV Forum學習(2022-12-20)

今天準備了3個問題,涵蓋了編譯、機制和算法,按照先容易後困難的順序進行整編。
1、Build samples programs
問題:
There’s some great examples in opencv/samples/cpp, but it looks like they don’t get compiled into an executable by default. Is there some setting or simple CMakeLists.txt edit to compile them?
I can copy and paste the code and compile it in a separate project, but it would be convenient to have everything in the opencv folder.
大意:
OpenCV中提供了很多例子,如何用起來?
回答:

 

 

Cmake確實爲編譯解決了很多問題。我們所謂“算法裁剪”,很多時候就是依靠Cmake實施的。
 
2、Slow frame read from webcam
As per the title, I’m seeing very slow frame reads from webcam. At a resolution at which it can output 120FPS, I’m only getting 20-40FPS using a very simple OpenCV application, while ffmpeg fed directly from the webcam gets ~60FPS while also doing h264 encoding and streaming, so something is definitely off. One other odd thing is that on one start it could stay locked at 50FPS, while in other instances it wouldn’t be able to get anything better than 20FPS for the duration of the run.
大意:使用OpenCV的時候,攝像頭降速了,如何解決。

 

 

有人提出使用多線程,但是目前流程已經是最簡化處理了。
 

 

 

管理員對Python的速度表示懷疑。

 

 

但是立刻有人給出了值得信服的測試結果。這樣看來,由於Python方面的不斷集成,真的有可能在默認設置下得到更好的速率。而C++方面由於尾大不掉,必須自己進行配置。
120FPS是真的有可能的,當我需要更高速率的時候,就應該回顧這篇文章。
 
3、Circle Detection Issues
提問:I have an image ill leave below but its one of the few issues I have been having so far.
 I have tried Houghcircles, SimpleBlobDetector, and CannyEdgeDetector I have had varying results with them, so far SimpleBlobDetector has ended up being one of the most accurate but it still leaves some outliers like this exact image below sometimes it wants to recognize the circle and outlines it, specifically the center post (Usually constantly jumping back and forth not very accurate)
 

 

 

I was wanting to see if there is any better options someone can point me towards for specifically the center post I have branched out as far as almost training my own dataset for this model alone but I feel like that is kind of pointless if there is possibly an easier way this object will ALWAYS be the same lighting and background and position as shown any ideas are welcome!
 I will need to be able to find the center of the post with X and Y as the machine needs to center over it which is why I opted for Blob Detection
Problems I’ve ran into:
1.) The background is almost pure white it is slightly out of focus on the camera to make sure it doesn’t cause excess noise but still does slightly
2.) The center post isn’t fully defined as it has 2 black pits in the plastic ring around it which has caused me issues.
3.) When I finally find something that works, it seems the live video feed causes some sporadic movement of the outlined circle usually jumping up to 10 pixels away from the center post.
後面補充了應用場景:

 

 

大意:找圓算法,尋找圓心。
 

 

 

管理員對常用算法提出了自己的意見和認知。
 

 

 

並且最終討論了攝像頭的選購。所以這篇帖子還是有工業背景、也有算法討論的,雖然沒有代碼細節,但是很有工業價值。
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章