首页 > 其他分享 >OpenCV Forum学习(2022-12-20)

OpenCV Forum学习(2022-12-20)

时间:2022-12-20 17:55:47浏览次数:65  
标签:webcam 12 20 center Forum some but OpenCV post

今天准备了3个问题,涵盖了编译、机制和算法,按照先容易后困难的顺序进行整编。 1、Build samples programs Build samples programs - C++ - OpenCV 问题: 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 Slow frame read from webcam - C++ - OpenCV 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 Circle Detection Issues - Python - OpenCV 提问: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. 后面补充了应用场景:

 

 

大意:找圆算法,寻找圆心。  

 

 

管理员对常用算法提出了自己的意见和认知。  

 

 

并且最终讨论了摄像头的选购。所以这篇帖子还是有工业背景、也有算法讨论的,虽然没有代码细节,但是很有工业价值。  

标签:webcam,12,20,center,Forum,some,but,OpenCV,post
From: https://www.cnblogs.com/jsxyhelu/p/16994789.html

相关文章