private void SegmentationWithEdgeDetection() { Segmentation segmentation = new Segmentation(GetCorrectedPoints(), trbToleranceLimit.Value); Bitmap res = segmentation.GetSegmentedPicture(_currImage); EdgeFinder edgeFinder = new EdgeFinder(res); res = edgeFinder.GetEdgePic(); pbGoodChipImage.Image = res; }
/// <summary> /// Конструктор принимает объект проекта отбраковки /// </summary> /// <param name="cullingProject">Ссылка на объект проекта отбраковки</param> /// <param name="islandLimit">Минимальный размер островка несоответствующих пикселей, которые не игнорируются</param> /// <param name="sumIslandLimit">Максимальный размер суммы пикселей в неигнорируемых островках, при котором чип считается годным</param> public VisualInspect(CullingProject cullingProject, int islandLimit, int sumIslandLimit) { _islandLimit = islandLimit; _sumIslandLimit = sumIslandLimit; // сохраняем проект отбраковки _cullingProject = cullingProject; // сохраняем сегментированное изображение годного чипа _segmentedMassGoodChip = cullingProject.UnitedImage; // находим края изображения годного чипа EdgeFinder edgeFinder = new EdgeFinder(_segmentedMassGoodChip); _edgeNearAreaMas = edgeFinder.GetEdgeNearArea(EdgeRadius); // фиксируем размеры массива _heightOfGood = _segmentedMassGoodChip.GetUpperBound(0) + 1; _widthOfGood = _segmentedMassGoodChip.GetUpperBound(1) + 1; // создаем объект для нахождения лучшего совмещения _superImposition = new SuperImposition(_segmentedMassGoodChip) { AcceptablePercent = ImpositionAcceptablePercent }; }
private void CreateUnionAndEdge() { Bitmap res = Utils.UnionOfImages(GetCorrectedPoints(), trbToleranceLimit.Value, _images); EdgeFinder edgeFinder = new EdgeFinder(res); res = edgeFinder.GetEdgePic(); FormShowPicture formShowPicture = new FormShowPicture {TopLevel = false}; FormMain.Instance.Controls.Add(formShowPicture); formShowPicture.Show(); formShowPicture.SetImage(res); }
private Bitmap GetEdgeImage() { Bitmap innerPic = new Bitmap(_pathToOriginalPic); Segmentation segmentation = new Segmentation(_cullingProject.KeyPoints, _cullingProject.Lim); Bitmap res = segmentation.GetSegmentedPicture(innerPic); EdgeFinder edgeFinder = new EdgeFinder(res); return edgeFinder.GetEdgePic(); }