first, the color of the program:
Green: Notes
Brown: Control Development
Light blue: External function--hdevelop function file, can be used in all Halcon programs
Dark blue: Image Acquisition and processing
Purple: intrinsic Function--local program function, only used in the current program
Second, VC + +, Halcon type conversion:
1, in C + + environment, take Htuple value method:
Htuple str = "Halcon";
Htuple num = +;
Htuple real = 1.23456;
const char *M_STR = ((hctrlval) str). S ();
Long M_num = ((hctrlval) num). L ();
int m_num_int = ((hctrlval) num). I ();
Double M_num = ((hctrlval) real). D ();
2. Halcon to C + +:
Htuple HTuple2;
Htuple2[0] = II; Htuple2[0]. I () =1234
htuple2[1] = DD; HTUPLE2[1]. D () =1234.1234
htuple2[2] = Strtemp.getbuffer (); HTUPLE2[2]. S () = "Halcon"
third, the $ syntax in Halcon
String types by kc***************** i1: = 123$ ' #o '//8 binary, 0 prefixes i2: = 123$ ' #x '//16 binary, 0x is prefixed, 7b is assignment i3: = 1 23$ ' #X '//16, 0x is the prefix, 7 B is the assignment, 7b and 7B are the same i4: = 123$ ' #f '//double type, by default six digits after the decimal point, $ ' #.3f ' for three bits after the decimal i5: = 123$ ' #g '//So that the number is always six bits, less than 0 , more than with e I6: = 123$ ' #G '//So that the number is always six bits, less than 0, more than with E i7: = 123$ ' #e '//Convert to scientific count i8: = 123$ ' #E '//Convert to Scientific Count ***************** integer ******* D1: = 123$ ' 6 '///less than six bits, text right-aligned, greater than not affect d2: = 123$ '-6 '///less than six-bit, text left-aligned, greater than does not affect d3: = 123$ '. 6 '//less than six bits, on the left side of 0, greater than not affect D4 : = 12345$ ' 10.5 '///less than 10 bits, text right-aligned, less than 5 bits on the left of 0, greater than not affect ***************** decimal ***************** g1: = 123.456$ '. 1 '//reserved 1-bit, rounded G2 : = 123.456$ '. 2 '//reserved 2-bit, rounded g3: = 123.456$ '. 3 '//reserved 3-bit, rounded g4: = 123.456$ '. 4 '//reserved 4-bit, rounded g5: = 123.456$ '. 5 '//reserved 5-bit, quad-loft Five into G6: = 123.456$ '. 15 '//reserved 15 bits, rounded, less than 0 G7: = 123.456$ ' 2.2 '//either $ ' 2.2 ' or $ ' 1.2 ', $ ' 7.2 ' are all related to. 2, keep two digits e1: = 123.456$ '. 1 E '//reserved decimal 1-bit e2: = 123.456$ '. 2e '//Reserved after decimal 2 bits e4: = 123.456$ '. 10e '//reserved 10 digits After decimal point, less than 0 ***************** text **************** * S1: = ' Hugo ' $ ' 10 'Text right-aligned s2: = ' Hugo ' $ '-10 '//text left justified
Four, OCR recognition precautions:
The training set data that comes with Halcon is a dark text on a bright background.
v. Create a procedure or function, or full-text editing
In the Operator edit window, main line to the right, there are four buttons to move the mouse to that position, there will be Chinese prompts, press the prompt to click the button.
Vi. Region of Interst-roi:
http://www.ihalcon.com/read-509-1.html#16125
Seven, image operation:
1. Addition: Reduces random noise in the image
2. Subtraction: Commonly used to detect changes between two or more images
3. Multiplication: Obscures the specified part of the image
4. Division: The nonlinear effects of corrective imaging equipment