ハリスの方法で、下の画像の白い図形の頂点を検出を行い、その頂点の上に点を置きたいと思っています。
しかし、Cv.CornerHarris()の関数を使っても、その後にどのように頂点の座標を得るのかがわかりません。どなたか、教えていただけませんか?
C#
1 2using System; 3using System.Collections.Generic; 4using System.Linq; 5using System.Text; 6using System.Threading.Tasks; 7using OpenCvSharp; 8 9namespace tyouten 10{ 11 class Program 12 { 13 static void Main(string[] args) 14 { 15 16 IplImage imgSrc = new IplImage("C:\pictures\sample2.png",LoadMode.Color); // 入力画像 17 IplImage imgGray = new IplImage("C:\pictures\sample2.png", LoadMode.GrayScale); // グレー画像 18 IplImage imgBinary = new IplImage(imgSrc.Size, BitDepth.U8, 1); // 二値化用の画像 19 Cv.CvtColor(imgSrc, imgGray, ColorConversion.BgrToGray); // グレー画像へ変換 20 Cv.Threshold(imgGray, imgBinary, 100, 255, ThresholdType.Binary); // 二値化 21 22 IplImage img3 = new IplImage(imgSrc.Size, BitDepth.F32, 1); // ハリス用の画像 23 24Cv.Normalize(imgBinary, imgBinary); // 正規化 25 Cv.CornerHarris(imgBinary, img3, 3); // コーナー検出 26 27Cv.ShowImage("Src", imgSrc); 28 Cv.ShowImage("Binary", imgBinary); 29 Cv.ShowImage("result ", img3); 30 31```![対象画像](87ccdfd13497ba5e5d3eb1c3edfcbbd3.png)
あなたの回答
tips
プレビュー