日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

【机器视觉】 dev_open_window算子

發布時間:2024/4/24 windows 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【机器视觉】 dev_open_window算子 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

00. 目錄

文章目錄

    • 00. 目錄
    • 01. 概述
    • 02. 簽名
    • 03. 描述
    • 04. 注意
    • 05. 參數
    • 06. 結果
    • 07. 附錄

01. 概述

dev_open_window - 打開一個新的圖形窗口。

02. 簽名

dev_open_window( : : Row, Column, Width, Height, Background : WindowHandle)

03. 描述

dev_open_window 打開一個新的圖形窗口,可用于顯示圖像、區域和線條等標志性對象以及執行文本輸出。 此窗口自動變為活動狀態,這意味著所有輸出(dev_display 和操作員結果的自動顯示)都重定向到此窗口。 這由活動按鈕上的發光燈顯示。

標準HALCON顯示,繪圖,鼠標,文本輸出和可視化參數算子(如disp_image,disp_region,draw_circle,get_mbutton,write_string,set_rgb等)需要在參數WindowHandle中返回的邏輯窗口號,它顯示在圖形窗口的標題欄。

Background中指定的顏色為創建的窗口背景顏色。 該參數不適用于算子open_window。 在那里,需要通過預先調用set_window_attr(::‘background_color’,Background :)可以實現相同的行為。

關閉圖形窗口可以通過按下窗口框的關閉按鈕或通過可視化菜單,或者通過調用dev_close_window。

圖形窗口的原點是坐標為(0,0)的左上角。 x值(column)從左到右增加,y值(row)從上到下增加。 默認情況下,坐標系的設置方式是在不剪切圖像的情況下顯示圖像,并完全適合圖形窗口。 對于在程序重置或新程序加載之后顯示的第一圖像,或者如果當前圖像具有與之前顯示的圖像不同的圖像大小,根據此規則,坐標系會適應于窗口大小。 窗口的大小不會自動調整,因此,如果圖像的寬高比與窗口的長寬比不同,則圖像會變形以適合窗口。 這可以通過“窗口大小”菜單進行更改。

通過滾動鼠標滾輪,使用“移動”或“縮放”模式,通過“圖像大小”菜單,借助“可視化參數”對話框上的“縮放”選項卡或使用操作符dev_set_part,可以交互式更改可見圖像部分。

每個圖形窗口都有一個歷史記錄,包含:

objects

顯示參數

歷史記錄會記錄從最近的清除動作或顯示全圖像以來已經顯示或改變了的圖形。 如果窗口的重繪被觸發,例如在改變窗口尺寸之后,為了重建完整的窗口內容會利用歷史記錄。 其他使用HALCON算子(如disp_image或disp_region,text(write_string)或geometric對象(disp_line,disp_circle等))顯示的圖形輸出不是歷史記錄的一部分,因此不能重繪。 只有使用HDevelop操作符dev_display或HDevelop操作(如雙擊圖標)顯示的對象類image,region和XLD才是歷史記錄的一部分。

按清空按鈕清除圖形窗口的內容和窗口的歷史。 這也可以通過使用算子dev_clear_window來實現。 這不會影響當前的顯示參數。

圖形窗口的大小可以通過用鼠標拖動窗口邊界交互地改變。 此外,可以通過“窗口大小”菜單將窗口大小調整為圖像大小(或其一部分或它的多倍)。 之后,使用與以前相同的可視部分自動重新顯示窗口內容(Afterwards, the window content is redisplayed automatically using the same visible part as before.)。

圖形窗口的顯示參數可以通過其context menu,可視化菜單,可視化參數對話框或適當的HDevelop算子(如dev_set_color,dev_set_line_width,dev_set_draw)來指定。 根據“立即應用”首選項,參數更改將應用于最后顯示的對象,或者從現在開始應用于所有后續對象。 與標準的HALCON窗口算子相反,新的設置也用于所有新的圖形窗口。

有關HALCON窗口的更多底層信息,請參見“HDevelop Reference Manual”以及“HDevelop用戶指南”的Graphical User Interface -> Graphics Window一章。

原文描述

dev_open_window opens a new graphics window, which can be used to display iconic objects like images, regions, and lines as well as to perform textual output. This window automatically becomes active, which means that all output (dev_display and automatic display of operator results) is redirected to this window. This is shown by the lucent lamp on the Active button.

The standard HALCON display, drawing, mouse, text output, and visualization parameter operators (like disp_image, disp_region, draw_circle, get_mbutton, write_string, set_rgb, etc.) need the logical window number that is returned in the parameter WindowHandle and displayed in the title bar of the graphics window.

The background of the created window is set to the color specified in Background. This parameter is not available for the operator open_window. There, the same behavior can be achieved by calling set_window_attr(::‘background_color’,Background:) in advance.

The graphics window is closed by pressing the Close button of the window frame, via the Visualization menu, or by calling dev_close_window.

The origin of the graphics window is the upper left corner with the coordinates (0,0). The x values (columns) increase from left to right, the y values (rows) increase from top to bottom. As a default, the coordinate system is set in a way that images are displayed without clipping and fitting completely into the graphics window. The coordinate system is adapted to the windows size according to this rule for the first image that is displayed after a program reset or the loading of a new program or if the current image has a different image size than the image that was displayed before. The size of the window is not adapted automatically, hence, if the aspect ratio of the image differs from that of the window, the image is distorted to fit into the window. This can be changed via the Window Size menu.

The visible image part can be changed interactively by spinning the mouse wheel, using the Move or Zoom mode, via the Image Size menu, with the help of the Zoom tab card on the Visualization Parameters dialog, or with the operator dev_set_part.

Each graphics window manages a history which contains the

objects and display parameters

which have been displayed or changed since the most recent clear action or display of a full image. This history is used if a redraw of the window is triggered, e.g., after a change of the windows size, in order to reconstruct the complete window contents. Other iconic output that was displayed using HALCON operators like disp_image or disp_region, text (write_string), or geometric objects (disp_line, disp_circle, etc.) are not part of the history, and can therefore not be redrawn. Only the object classes image, region, and XLD that are displayed with the HDevelop operator dev_display or by HDevelop actions like double clicking on an icon are part of the history.

Pressing the Clear button clears the graphics window contents and the history of the window. This can also be achieved by using the operator dev_clear_window. This will not effect the current display parameters.

The size of the graphics window can be changed interactively by dragging the window border with the mouse. Furthermore, it is possible to adapt the window size to the image size (or a part or multiple of it) via the Window Size menu. Afterwards, the window content is redisplayed automatically using the same visible part as before.

The display parameters of the graphics window can be specified via its context menu, the Visualization menu, the Visualization Parameters dialog, or the appropriate HDevelop operators like dev_set_color, dev_set_line_width, dev_set_draw. Depending on the Apply Immediately preference, the parameter changes are applied to the lastly displayed object or apply from now on for all following objects. In contrast to the standard HALCON window operators, the new settings are also used for all new graphics windows.

Additional information about the underlying HALCON window can be found at open_window and about the HDevelop graphics window in the “HDevelop Reference Manual” chapter Graphical User Interface -> Graphics Window as well as in the “HDevelop User’s Guide”.

04. 注意

使用HDevelop的代碼導出功能,為該算子生成的代碼可能與相關的HALCON算子具有不同的行為。 有關將HDevelop圖形算子導出為不同編程語言的代碼的詳細說明,請參閱“HDevelop User’s Guide”中的 Code Export -> General Aspects of Code Generation -> Graphics Windows一章。

05. 參數

Row (input_control) rectangle.origin.y → (integer)
  Row index of upper left corner.
  Default value: 0
  Typical range of values: 0 ≤ Row
  Minimum increment: 1
  Recommended increment: 1
  Restriction: Row >= 0

Column (input_control) rectangle.origin.x → (integer)
  Column index of upper left corner.
  Default value: 0
  Typical range of values: 0 ≤ Column
  Minimum increment: 1
  Recommended increment: 1
  Restriction: Column >= 0

Width (input_control) rectangle.extent.x → (integer)
  Width of the window.
  Default value: 256
  Typical range of values: 0 ≤ Width
  Minimum increment: 1
  Recommended increment: 1
  Restriction: (Width > 0) || (Width == -1)

Height (input_control) rectangle.extent.y → (integer)
  Height of the window.
  Default value: 256
  Typical range of values: 0 ≤ Height
  Minimum increment: 1
  Recommended increment: 1
  Restriction: (Height > 0) || (Height == -1)

Background (input_control) integer → (integer / string)
  Color of the background of the new window.
  Default value: ‘black’

WindowHandle (output_control) window → (integer)
  Window identifier.

HDevelop例程

stamp_catalogue.hdev Segment and group characters on a cluttered page
measure_screw.hdev Measure several features of a screw
fit_ellipse_tooth_rim_xld.hdev Approximate the contour of a tooth rim with an ellipse to find its center
find_pads.hdev Find pads on a die
display_operators.hdev Visualize results
dev_open_window.hdev Open graphics windows in HDevelop
dev_close_window.hdev Close graphics windows in HDevelop
critical_points_sub_pix.hdev Detect critical points with subpixel accuracy
clip_contours_xld.hdev Clip an XLD contour
advanced_visualization_settings.hdev Improve the visualization with transparency, anti-aliasing, and more

程序示例

dev_close_window () read_image (For5, 'for5') get_image_size (For5, Width, Height) dev_open_window (0, 0, Width, Height, 'black', WindowHandle) dev_display (For5) dev_set_lut ('rainbow') dev_display (For5) stop () dev_set_lut ('default') dev_display (For5) stop () dev_set_part (100, 100, 300, 300) dev_display (For5)

06. 結果

如果指定參數的值正確,則dev_open_window返回2(H_MSG_TRUE)。 否則會引發異常并返回錯誤代碼。

07. 附錄

7.1 機器視覺博客匯總
網址:https://dengjin.blog.csdn.net/article/details/116837497

總結

以上是生活随笔為你收集整理的【机器视觉】 dev_open_window算子的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。