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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人工智能 > ChatGpt >内容正文

ChatGpt

Halcon初学者知识:用set_paint直观显示图像的属性

發布時間:2025/3/21 ChatGpt 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Halcon初学者知识:用set_paint直观显示图像的属性 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、說明

????????背景知識:首先需要了解halcon的數據類型,見博文:

Halcon基礎知識:數據類型

????????就一個圖形對象來說,其顯示算子有:

  • ? ? ? ?dev_display
  • ? ? ? ?disp_obj
  • ? ? ? ?disp_image
  • ? ? ? ?disp_region
  • ? ? ? ?disp_xdl

顯示中有許多不同點,

  • 對象可能不同(image、region、xld)。
  • 通道不同,單通道圖像的呈現方法。
  • 數據側重點不同。

因此,有一種算子需要重視,如:

  • set_paint:? ?設置設備呈現方法
  • dev_set_paint函數方法

二、圍繞set_paint的慣用

2.1 set_paint的格式如下

set_paint(? : :? WindowHandle,? Mode : )

? 與其搭配的語句是:?disp_obj,? ?disp_image,? ? and disp_color.

2.2?通過下列操作,能夠將當前環境下的Mode提取出來

read_image(Image,'fabrik') open_window(0,0,-1,-1,'root','visible','',WindowHandle) query_paint(WindowHandle,Modi)open_file('my_param', 'output',FileHandle) fwrite_string(FileHandle,['available gray value modes: ',Modi]) fnew_line(FileHandle) *寫個空行結束

查看my_param文件,可以看到全部當前可以用的Mode:

  • dither4_1
  • dither4_2
  • dither4_3
  • threshold 如 ['threshold',Threshold]
  • floyd_steinberg
  • histogram
  • row? ? ? ? ? ? ? ? ? ? ? ? ? ?['row',Line,Scale]
  • column? ? ? ? ? ? ? ? ? ?? ['row',Line,Scale]
  • component_histogram
  • mean
  • 3d_plot? ? ??? ?['3d_plot',Mode,Step,qa,qb,qc,qd,Distance,CenterRow,CenterCol,CenterHeight]
  • 3d_plot_lines?
  • 3d_plot_hidden_lines
  • 3d_plot_point
  • vector_field
  • contour? ? ? ? ? ? ? ? ? ['contour',15,1]
  • lined
  • default

三、set_paint函數參數傳遞方法

需要多個參數的模式,其參數可以通過以下方式傳遞:

  • 僅傳遞模式名稱:分別使用默認值或最近使用的值。

????????示例:set_paint(WindowHandle,'3d_plot')

  • 傳遞所有值:可以設置所有輸出特性。

????????示例:set_paint(WindowHandle,['3d_plot','shaded', 8,0.939,-0.052,0.296,-0.165,0.401,0.072,-0.047,-0.073])

  • 僅傳遞前 n 個值:僅更改傳遞的值。

????????示例:set_paint(WindowHandle,['3d_plot','texture'])

  • 某些值由星號 ('*') 替換:替換參數的值未更改。

????????示例:set_paint(WindowHandle,['3d_plot','*',8])

四、案例集合

3.1 默認

set_paint(WindowHandle,'default')

3.2 顯示直方圖

read_image(Image,'fabrik') open_window(0,0,-1,-1,'root','visible','',WindowHandle) set_paint(WindowHandle,'histogram') disp_image(Image,WindowHandle)

3.3 將單通道圖像用3d模式顯示:

read_image(Image,'fabrik') dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle ) dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle1 ) disp_obj(Image,WindowHandle) dev_set_paint('3D-plot') disp_obj(Image,WindowHandle1)

3.4 以輪廓方式顯示

read_image(Image,'fabrik') dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle ) set_paint(WindowHandle,'contourline') dev_display(Image)

read_image(Image,'fabrik')
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle )
set_paint(WindowHandle,['contourline',60,1])? ? ?* 輪廓線內面積小于60忽略,線寬度1
dev_display(Image)?

3.5? 以局部方式顯示

read_image(Image,'fabrik')
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle )
get_system('width',Width)
get_system('height',Height)
set_part(WindowHandle,0,0,Height-1,Width-1)
disp_image(Image,WindowHandle)? ? * 此處將整個屏幕顯示出,圖片成了局部,相當于鏡頭拉遠

draw_rectangle1(WindowHandle,Row1,Column1,Row2,Column2)
set_part(WindowHandle,Row1,Column1,Row2,Column2)
disp_image(Image,WindowHandle)? ?*此處將先取圖像的局部矩形顯示出來,相當于鏡頭拉近

3.6 以矢量圖方式顯示?

????????輸出一個向量場。可以顯示包含相對坐標的矢量場或包含絕對坐標的矢量場。這種行為是通過可選參數 Mode 控制的。 Mode 的可能值為“auto”(可視化取決于向量場的語義類型)、“absolute”或“relative”。默認值為“自動”。在'vector_field'模式下,在像素位置為每個向量繪制一個直徑為CircleSize的圓。此外,使用當前向量繪制線段。繪制向量的步長,即繪制向量之間的距離,可以通過參數 Step 設置。可以使用參數 MinLength 抑制短向量。第四個參數值縮放矢量長度。需要注意的是,通過設置 'vector_field' 只改變內部參數 Mode、Step、MinLength、ScaleLength 和 CircleSize。當前顯示模式沒有改變。矢量場圖像始終顯示為矢量場,無論使用 set_paint 選擇哪種模式。

read_image(Image,'fabrik')
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle )
*set_paint(WindowHandle,['contourline',60,1])
set_paint(WindowHandle,['vector_field','auto',16,2,3,5])
dev_display(Image)?

3.7 顯示抖色,上述dither4_1不能顯示,尚不知道原因,望大家自己研究。

從仿色圖案(Dither Pattern)到半調(Halftone) - 知乎 (zhihu.com)

第四章 Dither的原理及其在ADC中的應用 - 百度文庫 (baidu.com)

總結

以上是生活随笔為你收集整理的Halcon初学者知识:用set_paint直观显示图像的属性的全部內容,希望文章能夠幫你解決所遇到的問題。

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