当我在OpenCV中使用相机时,终端中出现了几个消息,如:
mm40api: XIMEA Camera API V4.05.02
mm40api: Adding camera context: dwID=45405451 ptr=64049000 processID=000008DF
mm40api: Enable sensor
mm40api: Frequency 114 71
mm40api: Enabled 1 bandwidth 48000000
mm40api: Time needed to read BPL:150ms
mm40api: Successfully parsed BPL file, 1264 total corrected pixels
mm40api: SetGPIO 1 set to 8
mm40api: Frequency 50 31
mm40api: Enabled 1 bandwidth 48000000
mm40api: SetGPIO 1 set to 0
mm40api: AutoSetBandwidth measurement
mm40api: CalculateResources : Context 64049000 ID 45405451 m_maxBytes=512 m_maxBufferSize=524288
mm40api: AutoSetBandwidth measured 360Mbps. Safe margin 10% will be used.
mm40api: Current bandwidth limit auto-set to 324 Mbps (min:80Mbps,max:360Mbps)
mm40api: Frequency 50 31
mm40api: Enabled 1 bandwidth 40500000
mm40api: Frequency 42 29
mm40api: Enabled 1 bandwidth 40500000
mm40api: Frequency 42 29
mm40api: Enabled 1 bandwidth 40500000
mm40api: Frequency 21 14
mm40api: Enabled 1 bandwidth 40500000
mm40api: CalculateResources : Context 64049000 ID 45405451 m_maxBytes=512 m_maxBufferSize=524288
mm40api: StartVideoStream
mm40api: WorkerThread is up
有办法隐藏这些消息吗?谢谢。
这些可能来自底层API或驱动程序。它们不是OpenCV消息。
除了重定向或过滤stderr
和/或stdout
,可能没有太多你可以做的(从OpenCV)。
标准流重定向和/或过滤通常依赖于平台,但麻烦最少。
我猜你可以过滤掉所有以mm40api:
开头的行。但是,这只是针对您的特定相机/驱动程序。