[問題] 如何能得知各別標示物體的相關資訊呢
我遇到一個問題,就是我寫好一段C# code,也能把物體個別標示出來。
1. 但要怎麼才能得到各別標示物體的坐標值或是面積等相關資訊呢?!
2. 能儲存成個別標事物體的小圖片嗎?!
Image<Bgr, Byte> current_image2 = new Image<Bgr, byte>(current_bitmap);
Image<Gray, Byte> test_grayImage2 = current_image2.Convert<Gray, Byte>().Not();
Contour<Point> contours_set2 = test_grayImage2.FindContours(
Emgu.CV.CvEnum.CHAIN_APPROX_METHOD.CV_CHAIN_APPROX_NONE,
Emgu.CV.CvEnum.RETR_TYPE.CV_RETR_EXTERNAL);
Image<Gray, Byte> black_Image2 = test_grayImage2.CopyBlank();
for (; contours_set2 != null; contours_set2 = contours_set2.HNext)
{
if (contours_set2.Total < 30 /*&& contours_set.Total < 1000*/) continue;
current_image2.Draw(contours_set2.BoundingRectangle, new Bgr(Color.Red), 2);
}
target_bitmap = current_image2.Bitmap;
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.130.248.228
※ 文章網址: https://www.ptt.cc/bbs/C_Sharp/M.1441604084.A.920.html
推
09/07 14:25, , 1F
09/07 14:25, 1F
→
09/07 14:26, , 2F
09/07 14:26, 2F
→
09/07 16:12, , 3F
09/07 16:12, 3F
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章