개정판 16231f58
issue #0000 imagecompare 수정
- rect을 opencv에서 그려 이미지로 출력
Change-Id: I241d6b62eb8dd88ae4a970c4e531d079bbaa3602
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
5424 | 5424 |
recSize = new System.Drawing.Size((int)(ViewerDataModel.Instance.ImageViewWidth_C /1000),(int)(ViewerDataModel.Instance.ImageViewHeight_C/ 1000)); |
5425 | 5425 |
} |
5426 | 5426 |
|
5427 |
var result = await imageCompare.CompareReturnRectsAsync(ViewerDataModel.Instance.ImageViewPath, ViewerDataModel.Instance.ImageViewPath_C, recSize, imageSize); |
|
5428 |
|
|
5427 |
var rectColor = System.Drawing.Color.FromArgb(255, 244, 15, 100); |
|
5428 |
var result = imageCompare.CompareReturnDrawContours(ViewerDataModel.Instance.ImageViewPath, ViewerDataModel.Instance.ImageViewPath_C, rectColor, imageSize); |
|
5429 |
|
|
5429 | 5430 |
//borderComprareWait.Visibility = Visibility.Collapsed; |
5430 | 5431 |
|
5431 | 5432 |
CompareDisplay(result); |
... | ... | |
5437 | 5438 |
ClearCompareRect(); |
5438 | 5439 |
} |
5439 | 5440 |
} |
5440 |
private void CompareDisplay(List<Rect> rects)
|
|
5441 |
private void CompareDisplay(BitmapSource bitmapSource)
|
|
5441 | 5442 |
{ |
5442 | 5443 |
ClearCompareRect(); |
5443 | 5444 |
|
5444 | 5445 |
// UI 스레드에서 작업을 수행 |
5445 | 5446 |
Application.Current.Dispatcher.Invoke(() => |
5446 | 5447 |
{ |
5447 |
foreach (var d in rects)
|
|
5448 |
{
|
|
5449 |
d.Inflate(new Size(5, 5));
|
|
5448 |
Image img = new Image();
|
|
5449 |
img.Source = bitmapSource;
|
|
5450 |
canvas_compareBorder.Children.Add(img);
|
|
5450 | 5451 |
|
5451 |
var point = MarkupToPDF.Controls.Common.MathSet.getRectMiddlePoint(d); |
|
5452 |
var rectangle = new System.Windows.Shapes.Rectangle |
|
5453 |
{ |
|
5454 |
Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 244, 15, 126)), |
|
5455 |
Width = d.Width, |
|
5456 |
Height = d.Height, |
|
5457 |
RenderTransformOrigin = point |
|
5458 |
}; |
|
5459 |
Canvas.SetLeft(rectangle, d.X - ((point.X - d.X) / 2.0)); |
|
5460 |
Canvas.SetTop(rectangle, d.Y - ((point.Y - d.Y) / 2.0)); |
|
5452 |
//foreach (var d in rects) |
|
5453 |
//{ |
|
5454 |
// d.Inflate(new Size(5, 5)); |
|
5461 | 5455 |
|
5462 |
canvas_compareBorder.Children.Add(rectangle); |
|
5463 |
} |
|
5456 |
// var point = MarkupToPDF.Controls.Common.MathSet.getRectMiddlePoint(d); |
|
5457 |
// var rectangle = new System.Windows.Shapes.Rectangle |
|
5458 |
// { |
|
5459 |
// Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 244, 15, 126)), |
|
5460 |
// Width = d.Width, |
|
5461 |
// Height = d.Height, |
|
5462 |
// RenderTransformOrigin = point |
|
5463 |
// }; |
|
5464 |
// Canvas.SetLeft(rectangle, d.X - ((point.X - d.X) / 2.0)); |
|
5465 |
// Canvas.SetTop(rectangle, d.Y - ((point.Y - d.Y) / 2.0)); |
|
5466 |
|
|
5467 |
// canvas_compareBorder.Children.Add(rectangle); |
|
5468 |
//} |
|
5464 | 5469 |
|
5465 | 5470 |
canvas_compareBorder.Visibility = Visibility.Visible; |
5466 | 5471 |
|
5467 | 5472 |
// 애니메이션 설정 |
5468 | 5473 |
DoubleAnimation animation = new DoubleAnimation |
5469 | 5474 |
{ |
5470 |
From = 0.7,
|
|
5471 |
To = 0.3,
|
|
5472 |
Duration = new Duration(TimeSpan.FromSeconds(3)),
|
|
5475 |
From =0.39,
|
|
5476 |
To = 0.1,
|
|
5477 |
Duration = new Duration(TimeSpan.FromSeconds(2)),
|
|
5473 | 5478 |
AutoReverse = true |
5474 | 5479 |
}; |
5475 | 5480 |
|
내보내기 Unified diff