?
1 、 Halcon 的自我描述
Program?Logic
??Each?program?consists?of?a?sequence?of?HALCON?operators
??The?program?can?be?structured?into?procedures
??The?sequence?can?be?extended?by?using?control?operators?like?if,?for,?repeat,?or?while
??The?results?of?the?operators?are?passed?via?variables
??No?implicit?data?passing?is?applied
??Input?parameters?of?operators?can?be?variables?or?expressions
??Output?parameters?are?always?variables
??HDevelop?has?no?features?to?design?a?graphical?user?interface
??An?HDevelop?program?is?considered?as?a?prototypic?solution?of?the?vision?part?of?an?application
??HDevelop?is?typically?not?used?for?the?final?application
由此可以看出, Halcon 的定位是一個(gè)類(lèi)庫(kù),有著完整、快速實(shí)現(xiàn)函數(shù),同時(shí)提供了 HDevelop作為快速開(kāi)發(fā)的圖形化( IDE )界面;但是, Halcon 程序并不是一個(gè)完整的最終應(yīng)用軟件,它沒(méi)有用戶(hù)界面,也不提供顯示的數(shù)據(jù)(公用的數(shù)據(jù)格式)。
Halcon 的初學(xué)者也應(yīng)當(dāng)從參考 Halcon 的程序入手,熟悉 Halcon 類(lèi)庫(kù),也即 HDevelop-Based?Programming;在此基礎(chǔ)上,進(jìn)入 OR Class-Oriented?Programming。這也是 Halcon 推薦的開(kāi)發(fā)方式:
The?vision?part?is?solved?with?HDevelop, and?t he?application?is?developed?with?C++?or?Visual?Basic。
?
2 、 HDevelop 界面的學(xué)習(xí)
通過(guò)閱讀 Halcon 的 PPT ,學(xué)到了下面一些有用的信息:
??文件——瀏覽示例,可以看到很多有用的例子;
??程序窗體中,可以瀏覽與編輯 Procedues (過(guò)程),這個(gè)其實(shí)就是自定義函數(shù)咯~還可以自己修改這些過(guò)程,并添加說(shuō)明文檔;
??F4 ——將函數(shù)語(yǔ)句注釋掉; F3 ——激活;
??本地過(guò)程( Local?Procedue )與外部過(guò)程( Externel?Procedue )
?
3 、基本語(yǔ)法結(jié)構(gòu)
Halcon 的語(yǔ)法結(jié)構(gòu)
類(lèi)似于 Pascal? 與? Visual?Basic ,大部分的語(yǔ)句是 Halcon 提供的算子,此外也包含了少部分的控制語(yǔ)句;
不允許單獨(dú)聲明變量;
提供自動(dòng)的內(nèi)存管理(初始化、析構(gòu)及 OverWrite ),但句柄則需要顯示釋放;
C++ (算子模式)
通過(guò)代碼導(dǎo)出,以 C++ 為例,默認(rèn)導(dǎo)出為算子型的語(yǔ)法結(jié)構(gòu),而非面向?qū)ο蟮模辉诖四J较拢亢瘮?shù)聲明為全局類(lèi)型,數(shù)據(jù)類(lèi)型只需要用 Hobject 、 HTuple 兩類(lèi)類(lèi)型進(jìn)行聲明;
C++ (面向?qū)ο螅?
可以以面向?qū)ο蟮姆绞街貙?xiě)代碼,也即利用類(lèi)及類(lèi)的成員函數(shù);
在這種模式下,控制變量的類(lèi)型仍未 HTuple ,而圖形數(shù)據(jù)可以由多種類(lèi)型,如 HImage 等;
其他語(yǔ)言(略)
?
4 、 Halcon 數(shù)據(jù)結(jié)構(gòu)
兩類(lèi)參數(shù):圖形參數(shù)Iconic?(image,?region,?XLD)與控制參數(shù)Control?(string,?integer,?real,?handle),在 Halcon 算子的參數(shù)中,依次為:輸入圖形參數(shù)、輸出圖形參數(shù)、輸入控制參數(shù)、輸出控制參數(shù);并且其輸入?yún)?shù)不會(huì)被算子改變。
圖形參數(shù)Iconic:
Images
??Multiple?channels
??Arbitrary?region?of?interest
??Multiple?pixel?types(byte,?(u)int1/2/4,real,?complex,?direction,?cyclic,?vector_field)
byte,?uint2?// 灰度圖像的標(biāo)準(zhǔn)編碼
int1,?int2?//Difference?of?two?images?or?derivates?with?integer?precision(??)int4?// 兩幅灰度圖的頻譜
direction?// 圖片邊緣的梯度方向
real?// 邊緣提取及特定灰度值的輪廓
complex?// 圖片頻率分布
cyclic?//Assigning?one?"gray"?value?to?each?color(??)
vector_field?// 連續(xù)圖形的光學(xué)流分布
Regions
??Efficient?data?structure?(runlength?encoding)
??Extensive?set?of?operators
??Fastest?morphology?on?the?market
圖形編碼中,需要了解? row? 和? run? 兩個(gè)術(shù)語(yǔ);也是 Halcon?Region 存儲(chǔ)的方式
Extended?Line?Description?(XLD)
??Subpixel?accurate?line?and?edge?detection
??Generic?point?list?based?data?structure
??Handling?of?contours,?polygons,?lines,?parallels,?etc.
此外, Halcon 支持的類(lèi)型還包括圖形元組、控制變量元組及句柄:
元組的概念,使得可以用一個(gè)變量傳遞數(shù)個(gè)對(duì)象,可以由重載后的函數(shù)來(lái)進(jìn)行處理;圖形元組的下標(biāo)從 1 開(kāi)始,控制變量元組下標(biāo)從 0 開(kāi)始;句柄則可以用來(lái)描述窗體、文件等等,句柄不能是常量。
?
5 、 Halcon 語(yǔ)言
輸入控制參數(shù)可以是表達(dá)式,但圖形參數(shù)、輸出參數(shù)均應(yīng)為變量;
String 類(lèi)型變量由單引號(hào) ’括起來(lái);此外還有一些特殊字符;
Boolean 型變量包括? true?(?=?1?) 、? false?(?=?0?)? ;不為零的整數(shù)將被認(rèn)為 true ;但絕大多數(shù)的 Halcon 函數(shù)接受字符串型的表達(dá): ’true’‘false’,而非邏輯型表達(dá);
函數(shù)返回常量用于標(biāo)識(shí)錯(cuò)誤:
??H_MSG_TRUE?no?error?2
??H_MSG_FALSE?logical?false?3
??H_MSG_FAIL?operator?did?not?succeed??5
可以放在 try …catch…endtry 塊中,也可以用 dev_error_var() 與 ?dev_set_check()? 來(lái)捕獲;
控制語(yǔ)句結(jié)構(gòu):(與一般語(yǔ)言略有不同,它們也有輸入輸出變量)
??if??...??endif?/?if?...?else??...?endif?/?if?...?elseif?...?else?...?endif?
??for??...??endfor
??while??...??endwhile
??repeat?...?until
此外,也有關(guān)鍵字? break 、 continue 、 return 、 exit 、 stop? 用來(lái)控制語(yǔ)句的執(zhí)行;
賦值語(yǔ)句在 Halcon 中也被當(dāng)作函數(shù)來(lái)使用:
標(biāo)準(zhǔn)賦值
??assign(Expression,?ResultVariable)?// 編輯形式,永遠(yuǎn)都是輸入在前,輸出在后
??ResultVariable?:=?Expression?// 代碼形式
元組插入賦值
??insert(Tuple,?NewValue,?Index,?Tuple)?// 編輯形式
??Tuple[Index]?:=?NewValue?// 代碼形式
控制變量元組操作
??[t,t]?concatenation?of?tuples
??|t|??number?of?elements
??t[i]??selection?of?an?element
??t[i:j]??selection?of?a?part?of?a?tuple
??subset(t1,t2)?selection?from?t1?by?indices?in?t2?
圖形元組操作對(duì)應(yīng)函數(shù)
??[]??gen_empty_obj?()
??|t|??count_obj?(p,?num)
??[t1,t2]??concat_obj?(p1,?p2,?q)
??t[i]??select_obj?(p,?q,?i+1)
??t[i:j]??copy_obj?(p,?q,?i+1,?j-i+1)
??subset(t1,t2)?select_obj?(p,?q,?t2+1)
元組的數(shù)學(xué)運(yùn)算,如: A?*?B ,令? m?=?|A|,?n?=?|B| ;
若 m 、 n 不相等,且都大于 1 ,則錯(cuò)誤;否則返回三種情況:
??m=n=1 ,返回一個(gè)值;
??m=n>1 ,返回一個(gè)包含 m 個(gè)數(shù)的元組,值為兩元組各對(duì)于值的操作結(jié)果;
??m>1,n=1 ,返回一個(gè)包含 m 個(gè)數(shù)的元組,值為第二個(gè)數(shù)與第一元組各值的操作結(jié)果;
Halcon? 的數(shù)學(xué)運(yùn)算
算術(shù)運(yùn)算
??a?/?a?division
??a?%?a?rest?of?the?integer?division
??a?*?a?multiplication
??v?+?v?addition?and?concatenation?of?strings
??a?-?a?subtraction
??-a??negation
位運(yùn)算
??lsh(i,i)??left?shift
??rsh(i,i)??right?shift
??i?band?i??bit-wise?and
??i?bor?i??bit-wise?or
??i?bxor?i??bit-wise?xor
??bnot?i??bit-wise?complement
字符串操作
??v$s??conversion?to?string?// 字符串的格式化,有很豐富的參數(shù)
??v?+?v??concatenation?of?strings?and?addition
??strchr(s,s)??search?character?in?string
??strstr(s,s)??search?substring
??strrchr(s,s)??search?character?in?string?(reverse)
??strrstr(s,s)??search?substring?(reverse)
??strlen(s)??length?of?string
??s{i}?selection?of?one?character
??s{i:i}??selection?of?substring
??split(s,s)??splitting?to?substrings
比較操作符
??t?<?t??less?than
??t?>?t??greater?than
??t?<=?t???less?or?equal
??t?>=?t??greater?or?equal
??t?=?t??equal
??t?#?t??not?equal
邏輯操作符
??not?l??negation
??l?and?l??logical?’and’
??l?or?l?logical?’or’
??l?xor?l??logical?’xor’
數(shù)學(xué)函數(shù)
??sin(a)??sine?of?a
??cos(a)??cosine?of?a
??tan(a)??tangent?of?a
??asin(a)??arc?sine?of?a?in?the?interval?[-p/2,?p/?2],?a???[-1,?1]
??acos(a)??arc?cosine?a?in?the?interval?[-p/2,?p/2],?a???[-1,?1]
??atan(a)??arc?tangent?a?in?the?interval?[-p/2,?p/2],?a???[-1,?1]
??atan2(a,b)??arc?tangent?a/b?in?the?interval?[-p,?p]
??sinh(a)??hyperbolic?sine?of?a
??cosh(a)??hyperbolic?cosine?of?a
??tanh(a)??hyperbolic?tangent?of?a
??exp(a)??exponential?function
??log(a)??natural?logarithm,?a>?0
??log10(a)??decade?logarithm,?a>?0
??pow(a1,a2)??power
??ldexp(a1,a2)??a1?pow(2,a2)
其他操作(統(tǒng)計(jì)、隨機(jī)數(shù)、符號(hào)函數(shù)等)
??min(t)??minimum?value?of?the?tuple
??max(t)??maximum?value?of?the?tuple
??min2(t1,t2)??element-wise?minimum?of?two?tuples?
??max2(t1,t2)??element-wise?maximum?of?two?tuples?
??find(t1,t2)?indices?of?all?occurrences?of?t1?within?t2?
??rand(i)?create?random?values?from?0..1?(number?specified?by?i)?
??sgn(a)?element-wise?sign?of?a?tuple?
??sum(t)??sum?of?all?elements?or?string?concatenation
??cumul(t)?cumulative?histogram?of?a?tuple
??mean(a)??mean?value
??deviation(a)??standard?deviation
??sqrt(a)??square?root?of?a
??deg(a)??convert?radians?to?degrees
??rad(a)??convert?degrees?to?radians
??real(a)??convert?integer?to?real
??int(a)?convert?a?real?to?integer
??round(a)??convert?real?to?integer
??number(v)??convert?string?to?a?number
??is_number(v)??test?if?value?is?a?number
??abs(a)??absolute?value?of?a?(integer?or?real)
??fabs(a)??absolute?value?of?a?(always?real)
??ceil(a)??smallest?integer?value?not?smaller?than?a
??floor(a)??largest?integer?value?not?greater?than?a
??fmod(a1,a2)?fractional?part?of?a1/a2,?with?the?same?sign?as?a1
??sort(t)??sorting?in?increasing?order
??uniq(t)?eliminate?duplicates?of?neighboring?values(typically?used?in?combination?with?sort)
??sort_index(t)??return?index?instead?of?values
??median(t)?Median?value?of?a?tuple?(numbers)
??select_rank(t,v)?Select?the?element?(number)?with?the?given?rank
??inverse(t)??reverse?the?order?of?the?values
??subset(t1,t2)?selection?from?t1?by?indices?in?t2
??remove(t1,t2)?Remove?of?values?with?the?given?indices
??environment(s)??value?of?an?environment?variable
??ord(a)??ASCII?number?of?a?character
??chr(a)??convert?an?ASCII?number?to?a?character
??ords(s)??ASCII?number?of?a?tuple?of?strings
??chrt(i)??convert?a?tuple?of?integers?into?a?string
?
6 、 Halcon 名稱(chēng)解釋
??Operator:?A?procedure?of??the?HALCON?library?used?in?HDevelop?or?one?of?the?language?interfaces.
??Procedure?(of?HDevelop):?A?subroutine?defined?for?the?use?inside?HDevelop.
??Region:?Result?of?a?segmentation?like?threshold.?In?other?systems?called?blob,?area,?binary?image,?or?island.?Implemented?using?runlength?encoding.
??XLD:?Extended?Line?Description.?Universal?data?structure?used?to?handle?contour?based?data.?Mainly?used?in?the?context?of?subpixel?precise?measurement.
??Domain:?Part?of?the?image?which?is?used?for?processing.?In?other?systems?called?ROI?(region?of?interest).
??Channel:?One?image?matrix?of?a?multi-spectral?image.?One?example?is?the?red?channel?of?an?RGB?image.
??Iconic?data:?Overall?term?for?images,?regions,?and?XLD?data.?In?object?oriented?languages?(C++?and?COM)?and?in?HDevelop?iconic?data?is?represented?by?a?polymorphic?data?type.?In?object?oriented?languages?iconic?data?is?also?called?iconic?object.
??Control?data:?All?non?iconic?data.?Examples?are?single?values?(integer,?real,?and?string),?coordinates,?arrays?of?values.
??Tuple:?an?array?of?values?where?each?element?can?be?of?a?different?type.?One?can?have?both?iconic?and?control?tuples.
??HALCON?object:?Synonym?for?Iconic?object?/?data
??Image?acquisition?interface:?Interface?between?the?frame?grabber?/camera?driver?(SDK)?and?the?HALCON?library.?The?Image?acquisition?interface?is?a?DLL?which?is?dynamically?loaded?when?calling?open_framegrabber.
??Language?interface:?Software?that?enables?the?programmer?to?use?the?HALCON?library?in?a?given?language?(e.g.,?C++).
??Extension?Package:?A?mechanism?that?enables?the?user?to?fully?integrate?user-defined?procedures?into?the?HALCON?environment.?The?extension?package?concept?gives?full?access?to?the?internal?data?structures?of?HALCON.
??License?file:?File?“l(fā)icense.dat“?in?the?directory?“l(fā)icense“.??This?file?is?used?together?with?hardware?components?(dongle?or?Ethernet?card)?to?check?if?a?correct?license?is?available.
??Help?files:?Files?in?the?directory?“help“?which?are?used?to?get?online?information?about?all?HALCON?operators.?This?is?extensively?used?by?HDevelop.
??Shape-Based?Matching:?Finding?of?an?object?in?an?image?based?on?a?predefined?model.?The?shape?based?matching?uses?features?to?quickly?locate?objects?very?precisely.
??Variation?Model:?A?method?to?do?print?checking?by?presenting?multiple?good?patterns?to?the?system.?The?variation?model?learns?the?normal?variation?a?good?pattern?and?based?on?this?information?can?detect?real?defects.
??Measure?Tool:?A?set?of?operators?to?find?the?exact?location?of?edges?along?lines?or?circular?arcs.?Other?systems?call?the?similar?tool,?e.g.,?caliper.
??Accuracy:?The?deviation?from?the?true?value
??Precision:?The?standard?deviation?of?the?measurement
?
7 、 Halcon 函數(shù)
典型函數(shù)
??Filtering?(noise,?smoothing,?edge,?bit,?arithmetic,?enhancement)
??Segmentation?(thresholding,?topology,?region?growing,?classification,?comparison)
??Region?processing
??Morphology
??Feature?extraction
??Edge?detection
??Color?processing?and?classification
??OCR?/?OCV
??Bar?code?/?data?code
??Measurement
??Rectification
??Gray?value?matching
?
8 、 Halcon? HDevEngine
HDevEngine允許用戶(hù)在應(yīng)用程序中直接調(diào)用 Halcon 程序( *.hdvp ),適用范圍包括 C++ 、 COM 、 .NET 語(yǔ)言。具體功能為:
??載入并執(zhí)行 Halcon 程序( HDevelop?programs)
??載入、刪除、執(zhí)行HDevelop過(guò)程(HDevelop?procedures )
??查詢(xún)以載入的HDevelop過(guò)程的接口
??將正確的參數(shù)值傳遞給HDevelop過(guò)程,執(zhí)行并獲得結(jié)果
??重新實(shí)現(xiàn)了HDevelop的某些內(nèi)部算子( operator ),例如 dev_display
??HDevEngine錯(cuò)誤處理
在 C++ 中,使用 HDevEngine需要包括頭文件#include?"HDevEngineCpp.h",并包含附加的可執(zhí)行文件hdevenginecpp.lib,具體見(jiàn)示例。
利用HDevEngine,可以很方便得實(shí)現(xiàn)多線(xiàn)程。
?
9 、 Halcon 數(shù)據(jù)結(jié)構(gòu)( 2 )
Halcon 中, Image?=?Channel?+?Domain?,? 像素點(diǎn)存放在 Channel 矩陣中,根據(jù) ROI 來(lái)描述 Image 。
Image 相關(guān)操作:
??輸入:從文件、從設(shè)備
??生成:外部圖像數(shù)據(jù)、空內(nèi)存區(qū)域;
??顯示:disp_image() 圖像首通道灰度圖; disp_color()? 彩色圖; disp_channel() 某特定通道; disp_obj()? 自動(dòng)判別類(lèi)別;
??縮放: set_part()? 設(shè)置顯示區(qū)域; set_part_style()? 設(shè)置顯示參數(shù);
??3D 顯示:(略)
Rules?to?Display?Gray?Images沒(méi)特別懂
邊界點(diǎn)的處理:鏡像、常數(shù)、延續(xù)、周期(略):
域的局限性:一些算子總是要處理周?chē)木匦螀^(qū)域,比如 mean_image() ,并且總是先處理小的區(qū)域;
測(cè)量工具中的 ROIs 比較特殊,這種 ROIs 并不依附于 Image 上,而是在算子 gen_measure_*() 后產(chǎn)生,并且也只能是任意朝向的矩形、圓弧形區(qū)域;
處理多通道圖像:
??分割:Gray?operators僅適用第一通道,Color?operators:?使用前三個(gè)通道,Multi?channel?operator會(huì)使用全部通道;
// 對(duì)“ Gray?operators僅適用第一通道”的解釋?zhuān)簩?shí)際上,灰度圖,就是用第一通道( Red )像素點(diǎn)值所構(gòu)建出來(lái)的那幅圖。
??過(guò)濾:所有通道被處理時(shí)均使用相同的參數(shù),并且結(jié)果的通道數(shù)與處理的圖片相同;
??可以將域的處理結(jié)果,與原圖像結(jié)合在一起作為輸入圖像;
??通道處理:count_channels(),decompose*(),?compose*(),?access_channel(),?append_channel(),?channels_to_image(),?image_to_channels()
圖像金字塔中,第一個(gè)圖像為最大的圖像,各圖像有各自的區(qū)域
標(biāo)準(zhǔn)圖形( Shape ): circle 、 ellipse 、 rectangle1 、 rectangle2 、 line 、 polygon
特殊區(qū)域圖形: gen_grid_region():?grid 、 lines 、 points,?gen_checker_region()
圖像處理:
??修改:set_grayval()?:?Modify?one?or?more?pixels?of?the?input?image;paint_gray():?Paint?part?of?an?image?into?another?image;?overpaint_gray():?Paint?part?of?an?image?into?the?input?image;?paint_region():?Paint?the?region?with?a?constant?gray?value?into?an?image;?overpaint_region()?:?Paint?the?region?with?a?constant?gray?value?into?the?input?image
??復(fù)制:crop_part():?Crop?a?rectangle,?given?by?upper?left?corner?and?size;?crop_rectangle1():?Crop?a?rectangle,?given?by?upper?left?and?lower?right?corner;?crop_domain():?Crop?area?of?the?smallest?rectangle1?of?the?domain;?crop_domain_rel():?Like?crop_domain?but?with?the?possibility?to?change?the?size?of?bounding?box;?change_format():?Limit?the?size?of?the?image?at?the?lower?or?the?right?part;?get_grayval():?Access?one?or?multiple?pixel?values
??Tile:?tile_images(),?tile_images_offset(),?tile_channels()
?
10 、 Halcon 數(shù)據(jù)結(jié)構(gòu)( 3 )
區(qū)域運(yùn)算:
??并: union1() 、 union2() ;
??交: intersection();
??差: difference();
??補(bǔ): complement() ;
圖形顯示參數(shù)設(shè)置:
??顯示模式: s et_draw();? 參數(shù): margin 、 filled
??線(xiàn)寬線(xiàn)形: set_line_width();?set_line_style();
??顏色: set_color();?set_colored();?set_rgb();?set_gray();
??顯示圖形: set_shape();? 參數(shù): original 、 outer?circle 、 inner?circle 、 rectangle1 、 rectangle2 、 ellipse 、 icon
??set_icon
?
11 、 Halcon 數(shù)據(jù)結(jié)構(gòu)( 4 )
關(guān)于 XLD ,簡(jiǎn)要寫(xiě)一下:
圖像均用像素點(diǎn)保存,而像素點(diǎn)是整型的,不連續(xù)的; Halcon 做了拓展,定義了亞像素( subpixel )的對(duì)象: xld ;其實(shí) xld 已經(jīng)用過(guò)了,比如提取邊緣、構(gòu)建輪廓等等, xld 在模板匹配、圖形校準(zhǔn)等多方面有重要的用途。
?
12 、色彩? color
在視網(wǎng)膜底部,有三類(lèi)感光細(xì)胞,它們分別探測(cè)不同頻率的光,產(chǎn)生 RGB 神經(jīng)沖動(dòng),并把這些神經(jīng)沖動(dòng)傳遞下去;經(jīng)過(guò)另外的細(xì)胞的處理,轉(zhuǎn)換成 1 個(gè)亮度通道、兩個(gè)色彩通道。
??The?RGB?stimulus?is?converted?to?a?luminance?and?2?chrominance?channels
所以, RGB 圖是原始的感光圖,而人眼的感覺(jué),卻不是 RGB 三通道的疊加;更直觀(guān)地描述人的感覺(jué),需要用到其他的色彩空間,比如 hsv 空間。
不同頻率的光,會(huì)產(chǎn)生不同的顏色;而光只有三種顏色,這是因?yàn)槿搜壑挥腥N光感受器。
所以有,任何光產(chǎn)生的顏色,都能夠由這三種純色來(lái)合成,這就是光的三元色。
?
?
對(duì)于相機(jī)來(lái)說(shuō),能夠檢測(cè)到的光譜范圍比人眼要寬泛,比如紅外相機(jī)等;為了獲得人眼類(lèi)似的圖像,可以加上過(guò)濾裝置,濾去超出 400-700nm 范圍的光線(xiàn)。
?
13 、色彩空間及? Halcon 顏色處理
CCD 彩色相機(jī)有 R 、 G 、 B 三種感光芯片,捕捉不同顏色,然后轉(zhuǎn)換為 RGB 三通道。
顏色空間:
??RGB?Red 、 Green 、 Blue 三色通道,對(duì)光來(lái)說(shuō),猶如在黑暗中點(diǎn)亮各分色。
??CMY?Cyan 、 Magenta 、 Yellow? 三顏色通道,猶如在白紙上圖顏料
??YUV 、 YIQ ?Y 描述亮度、其余兩通道描述顏色(的差值),用于電視轉(zhuǎn)播
??ARgYb?與上類(lèi)似, A 描述亮度,其余兩者描述顏色差值
??I1i2i3?與上類(lèi)似, i1 描述亮度
??HSI?Hue 、 Saturation 、 Intensity? 分別描述顏色、飽和度、亮度
??HSV?與上類(lèi)似,這里的 V 描述亮度,方法與上不同
??HSL?與 HSI 類(lèi)似, L 描述亮度,但 Hue 與之不同
??HIS?與HIS類(lèi)似
??Uniform?Color?Space 、 CIE?uv? 用二維圖描述色彩
??CIE?Lab? 高級(jí)色彩空間,較少使用
?
顏色空間的轉(zhuǎn)換,依靠 GPU 進(jìn)行運(yùn)算: trans_from_rgb() ,速度快
Scale_image()? 可以對(duì)單通道( RGB 、或 HSV 中的)進(jìn)行重新渲染;
顏色的選取,通過(guò)對(duì) Hue 通道進(jìn)行 threshold()
2D?Histogram? 可用來(lái)描述兩通道( RGB 、 HSV 等中的)相應(yīng)值對(duì)應(yīng)關(guān)系,可用來(lái)選取顏色相近區(qū)域: histo_2dim()
N維像素分類(lèi): learn_ndim_norm() 、 learn_ndim_box()?
LUT : MLP 、 SVM 、 GMM
彩色過(guò)濾器:用于彩色圖像的分割等: edges_color() 、 edges_color_sub_pix() 、 lines_color()
?
14 、 Halcon? 窗體
Halcon 窗體的坐標(biāo)系統(tǒng): (Row,?Column)?(Width,?Height)
圖形:可以顯示灰度圖、彩色圖、 3D ;定義要顯示的區(qū)域,插值
區(qū)域:繪圖模式 (Fill 、 Margin) ,邊界、線(xiàn)寬,定義色彩模式,自動(dòng)圖形轉(zhuǎn)換
繪圖:點(diǎn)、線(xiàn)、 xld 等
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061
微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元

