Code description of angular detection operator

xiaoxiao2021-03-05  26

The simplest angular point detection operator, but due to the use of non-maximum suppression, the effect and OpenCV are equivalent.

TPOINFO = Record Info: Tpoint; W: Extended; Color: TLABCOLOR;

TsinglePointInfoarray = array of tpointinfo;

Procedure CornerDetect (Width, Height: Longint); VAR i, J, FI, FJ, SUM: Longint; Begin PointCount: = 0; for i: = 7 to Width - 8 Do for J: = 7 To Height - 8 Do Begin SUM: = 0; for fi: = i - 7 to i 7 do for fj: = j - 7 to j 7 do sum: = sum abs (imagegray [i, j] - imagegray [fi, fj]) ImagePoint [i, j]: = SUM DIV $ 100; end; {Standard angular detection operator part} for i: = 7 to width - 8 do for j: = 7 to height - 8 do beg: = imagepoint [ I, J]; IF sum> $ 20 kilin wbpoint [i, j]: = true; inc; I - 7 to i 7 do begin for fj: = J - 7 To J 7 Do if ImagePoint [FI, FJ]> Sum the Begin Wbpoint [I, J]: = FALSE; DEC (PointCount); Break; End; IF Not Wbpoint [i, J] Then Break; End; Else Wbpoint [i, j]: = false; End; {Using non-maximum suppression to suppress a fake angle} setlength; fi: = 0; for i: = 7 to width - 8 do for j: = 7 To HEIGHT - 8 DO if Wbpoint [i, j] Then Begin CornerPoint [Fi] .info.x: = i; corre: = j; inc (FI); end; {output is a point sequence } END;

The input imageGray is the grayscale description of the image, WbPoint is the Boolean array, and imagePoint is the detected value after the standard angle detection operator runs.

转载请注明原文地址:https://www.9cbs.com/read-34270.html

New Post(0)