Tag: 图像处理

如何将一个图像叠加到另一个图像上?

我想显示由两个图像组成的图像。 我希望image rectangle.png在它上面用image sticker.png显示,其左侧角落在像素10,10处。 这是我得到的,但我如何组合图像? Image image = new Image(); image.Source = new BitmapImage(new Uri(@”c:\test\rectangle.png”)); image.Stretch = Stretch.None; image.HorizontalAlignment = HorizontalAlignment.Left; Image imageSticker = new Image(); imageSticker.Source = new BitmapImage(new Uri(@”c:\test\sticker.png”)); image.OverlayImage(imageSticker, 10, 10); //how to do this? TheContent.Content = image;

validateImageData参数和Image.FromStream()

我关心这个重载中的第三个参数validateImageData。 文档没有解释太多,只是说它导致图像数据被validation但没有细节,究竟是做了什么来validation图像数据? public static Image FromStream ( Stream stream, bool useEmbeddedColorManagement, bool validateImageData ) 我想在Web应用程序中使用它,所以,我想知道如果我将validateImageData设置为true将会发生什么,我想确保用户上传的是有效图像,是否建议将validateImageData设置为true或者是否足以在抛出exception时捕获exception? 另外,将validateImageData设置为true可以以任何方式影响性能吗? (用户可以上传最大250k的图片) 谢谢

最快的Sobel边缘检测C#

我想制作一个实现sobel边缘检测的程序。 这是我的代码: private Bitmap SobelEdgeDetect(Bitmap ori) { Bitmap b = original; Bitmap bb = original; int width = b.Width; int height = b.Height; int[,] gx = new int[,] { { -1, 0, 1 }, { -2, 0, 2 }, { -1, 0, 1 } }; int[,] gy = new int[,] { { 1, 2, 1 […]

获取特定的图像部分(图片)

我想剪切图片的特定部分,并用它来比较裁剪后的图像与HDD中存储的图像。 问题是我不知道如何获得源图像的特定部分。 我知道要裁剪的图像的位置(X,Y)。

如何在dicom中绘制侦察/参考线

我是dicom开发小组的初学者。 我需要在dicom图像上创建一个定位器图像线。 那么,有什么好主意吗? 任何极客。

在c#中替换图像中的颜色

在不影响纹理的情况下,C#替换图像某些部分的颜色的方式是什么? 你可以在这里看到结果的好例子 谢谢

对于jpg图像文件,获得3-4个平均主色

我希望能够检测到jpg图像文件的3-4种主要颜色。 示例图像和示例代码如下: – 红色,黑色,白色 – 白色,绿色,粉红色 – 蓝色,黄色,黑色 我修改了一些代码以获得以下内容,但仍然无法对颜色进行分组。 public static int RoundColorToGroup(int i) { int r = ((int)Math.Round(i / 10.0)) * 10; if (r > 255) r = 255; return r; } [TestMethod] public void AverageColorTest_WebExample() { Bitmap bm = new Bitmap(“C:\\Users\\XXXX\\Desktop\\example1.jpg”); int width = bm.Width; int height = bm.Height; int red = 0; […]

位图步幅和4字节关系?

这句话的意思是: Stride属性,以字节为单位保存一行的宽度。 然而,行的大小可能不是像素大小的精确倍数,因为为了提高效率,系统确保将数据打包成以四字节边界开始并填充为四个字节的倍数的行。

我需要进行直方图拉伸

我有一个BitmapFrames数组,需要进行直方图拉伸。 我知道这与直方图均衡化不同,最终结果是什么…… sorta。 问题是我得到直方图后完全不知道该怎么做。 到目前为止,我的代码为直方图创建了一个数组,所以我知道每个值有多少个像素。 但在那之后我不知道该怎么办。 这是我到目前为止的代码…现在它使直方图然后直方图均衡…这不是我想要的…我只是想了解更多直方图 [Cmdlet(VerbsData.ConvertTo, “HistoStretch”)] public class HistoStretchCmdlet : PSCmdlet { private BitmapFrame[] bFrame, outFrame; private BitmapSource src; private double pixelsize; private byte[] pixels, outPixels; private byte MAX_VAL; private int[] histogram; private int cf, start; [Parameter(ValueFromPipeline = true, ValueFromPipelineByPropertyName = true), ValidateNotNullOrEmpty] public BitmapFrame[] Bitmap { get { return bFrame; } […]

如何使用syndicationFeed从rss中读取图像URL?

如何获取图片url? 假设标签是 在syndicationFeed中使用syndicationItem? 我有类似的东西 Stream stream = e.Result; XmlReader response = XmlReader.Create(stream); SyndicationFeed feeds = SyndicationFeed.Load(response); foreach (SyndicationItem ff in feeds.Items) { RssItem rssItem = new RssItem(ff.Title.Text, ff.Summary.Text, ff.PublishDate.ToString(), ff.Links[0].Uri.AbsoluteUri, **ff.image?????** ); rssItems.Add(rssItem); } 任何帮助?