python opencv cv2.namedWindow(winname, flags=None) (命名)创建窗口 cv::WindowFlags
生活随笔
收集整理的這篇文章主要介紹了
python opencv cv2.namedWindow(winname, flags=None) (命名)创建窗口 cv::WindowFlags
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
def namedWindow(winname, flags=None): # real signature unknown; restored from __doc__"""namedWindow(winname[, flags]) -> None. @brief Creates a window. 創建一個窗口。. . The function namedWindow creates a window that can be used as a placeholder for images and. trackbars. Created windows are referred to by their names.· 名為Window的函數創建一個可用作圖像和軌跡欄的占位符的窗口。 創建的窗口由其名稱引用。. . If a window with the same name already exists, the function does nothing.· 如果已經存在具有相同名稱的窗口,則該功能不執行任何操作。. . You can call cv::destroyWindow or cv::destroyAllWindows to close the window and de-allocate any associated. memory usage. For a simple program, you do not really have to call these functions because all the. resources and windows of the application are closed automatically by the operating system upon exit.· 您可以調用cv :: destroyWindow或cv :: destroyAllWindows關閉窗口并取消分配任何關聯的內存使用情況。 對于簡單的程序,您實際上不必調用這些函數,因為在退出時,操作系統會自動關閉應用程序的所有資源和窗口。. . @note. . Qt backend supports additional flags Qt后端支持其他標志:. - **WINDOW_NORMAL or WINDOW_AUTOSIZE:** WINDOW_NORMAL enables you to resize the. window, whereas WINDOW_AUTOSIZE adjusts automatically the window size to fit the. displayed image (see imshow ), and you cannot change the window size manually.· WINDOW_NORMAL使您能夠調整窗口大小,而WINDOW_AUTOSIZE會自動調整窗口大小以適合顯示的圖像(請參見imshow),并且您不能手動更改窗口大小。. - **WINDOW_FREERATIO or WINDOW_KEEPRATIO:** WINDOW_FREERATIO adjusts the image. with no respect to its ratio, whereas WINDOW_KEEPRATIO keeps the image ratio.· WINDOW_FREERATIO調整圖像時不考慮其比例,而WINDOW_KEEPRATIO則保留圖像比例。. - **WINDOW_GUI_NORMAL or WINDOW_GUI_EXPANDED:** WINDOW_GUI_NORMAL is the old way to draw the window. without statusbar and toolbar, whereas WINDOW_GUI_EXPANDED is a new enhanced GUI.· WINDOW_GUI_NORMAL是繪制沒有狀態欄和工具欄的窗口的舊方法,而WINDOW_GUI_EXPANDED是新的增強型GUI。. By default, flags == WINDOW_AUTOSIZE | WINDOW_KEEPRATIO | WINDOW_GUI_EXPANDED· 默認情況下,標志== WINDOW_AUTOSIZE | WINDOW_KEEPRATIO | WINDOW_GUI_EXPANDED. . @param winname Name of the window in the window caption that may be used as a window identifier. 窗口標題中可以用作窗口標識符的窗口名稱。. @param flags Flags of the window. The supported flags are: (cv::WindowFlags)窗口的標志。 支持的標志是:(cv :: WindowFlags)"""pass
官網:cv :: WindowFlags
一般不用設置flag,默認是flags == WINDOW_AUTOSIZE | WINDOW_KEEPRATIO | WINDOW_GUI_EXPANDED,上面有寫。
設置了一下:
cv2.namedWindow('{}'.format(serial_list[i]), flags=cv2.WINDOW_NORMAL | cv2.WINDOW_KEEPRATIO | cv2.WINDOW_GUI_EXPANDED)表示沒啥效果。。。固定不了比例
其他人也有相似問題:OpenCV CV_WINDOW_KEEPRATIO doesn’t work
暫未找到解決辦法。。。
總結
以上是生活随笔為你收集整理的python opencv cv2.namedWindow(winname, flags=None) (命名)创建窗口 cv::WindowFlags的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python opencv imread
- 下一篇: python 文件操作 os.path.