Tag: 图像处理

使用c#或c ++进行分水岭

我试图将Matlab函数watershed转换为C#或C ++。 我试图使用此代码,但CvFindContours使用此图像返回NULL 。 我也试过使用这个实现,但我遇到了FilterGrayToGray问题。 有谁知道我如何解决我的问题或如何计算我的图像上的分水岭? 有人能更准确地解释我的流域meyers泛滥算法吗?

如何用Image中的其他颜色替换像素颜色?

我有一个图像,我可以使用Martix读取它的所有像素颜色…如何更改任何像素的RGB如果我想将其转换为最接近的颜色(黑色,红色或白色) 我在Matrix中读取图像的代码是: string sourceimg = @”D:\ProductionTools\Taskes\Image Processing\Test\001.jpg”; //… Bitmap imageoriginal = new Bitmap(sourceimg); int height = imageoriginal.Height; int width = imageoriginal.Width; Color[][] colormatrix = new Color[width][]; for (int i = 0; i < width; i++) { colormatrix[i] = new Color[height]; for (int j = 0; j < height; j++) { colormatrix[i][j] = new Color(); colormatrix[i][j] […]

获取远程图像尺寸

给定图像的URL(而不是图像本身),获得它的尺寸最有效的是什么? 我想更改图像标记( )中的高度和宽度属性,如果它大于200×200。 但是,如果它小于那个,那么我想保持它的大小。 (我正在使用ASP.NET / C#)

如何测量.NET中Drawing.Bitmap绘制的字符串的像素宽度?

我正在生成一个包含动态编写文本的.png图像。 出于文件大小的原因,我需要创建具有最小宽度的位图。 我该怎么做呢?

帮助Bitmap解码器

我一直在研究位图解码器,但我处理像素数据的算法似乎不太合适: public IntPtr ReadPixels(Stream fs, int offset, int width, int height, int bpp) { IntPtr bBits; int pixelCount = bpp * width * height; int Row = 0; decimal value = ((bpp*width)/32)/4; int RowSize = (int)Math.Ceiling(value); int ArraySize = RowSize * Math.Abs(height); int Col = 0; Byte[] BMPData = new Byte[ArraySize]; BinaryReader r = new […]

如何识别/检查模糊图像?

我们如何识别给定图像模糊或C#中模糊的百分比? 有没有可用的API? 或者任何有用的算法? 谢谢!

无论如何使用asp.net mvc从3个图像URL中制作一个图像?

我想构建一个类似于nametest或Meaww的facebook应用程序,几乎成功地将我的API调用到Facebook Graph API并从facebook返回数据。 令我困惑的是上述Web应用程序的UI。 当您在Meaww或Nametests上完成测试时,结果将以图像(Jpeg)格式呈现给用户。 我只是不知道他们如何设法使用所有CSS样式等将HTML转换为动态图像以及它们如何将其作为图像返回给用户? 是否有可能在ASP.NET MVC Too中实施此场景? 如果是的话,我需要提示做一下。 下面是Meaww作为测试结果生成的图像。 编辑:更具体一点……我的控制器中有一个public async Task FB_Analyse()动作,它通过图形API调用从facebook获取数据到facebook,然后将数据值传递给模型,然后结束of Action返回如下视图: public async Task FB_Analyse() { var access_token = HttpContext.Items[“access_token”].ToString(); if (!string.IsNullOrEmpty(access_token)) { var appsecret_proof = access_token.GenerateAppSecretProof(); var fb = new FacebookClient(access_token); #region FacebookUser Name and Picture plus other Info //Get current user’s profile dynamic myInfo = await fb.GetTaskAsync(“me?fields=first_name,last_name,link,locale,email,name,birthday,gender,location,age_range,about”.GraphAPICall(appsecret_proof)); dynamic […]

C#:将图像保存到DB中

有人可以给我一些关于如何在C#中将图像文件保存到DB的建议吗? 我会保存很多图像,那么减少所需空间的最佳方法是什么? 我目前在DB中使用varbinary(max)字段。 谢谢!

将C ++ dll导出到c#

‘using System; ‘using System.Collections.Generic; ‘using System.Drawing; ‘using System.Windows.Forms; ‘using Emgu.CV; ‘using Emgu.CV.Structure; ‘using Emgu.CV.CvEnum; ‘using System.IO; ‘using System.Diagnostics; ‘using System.Runtime.InteropServices; ‘namespace FaceStat ‘{ ‘class Form1 : Form { // public static extern void AsmSearchDll(out int nlmarks, out int lmarks, string imgname, byte imgdata, int width, int height, int is_color, string conf_file0, string conf_file1); [DllImport(@”../data/stasm_dll.dll”)] public […]

缩放用户控件中的裁剪像素

我开发了一个用户控件。 用户控制就像一个放大镜玻璃。 用户控件具有图像按钮,其显示逐像素裁剪的图像。 StorageFile storageFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(“ms-appx:///Assets/wallpaper.jpg”, UriKind.RelativeOrAbsolute)); using (Windows.Storage.Streams.IRandomAccessStream fileStream = await storageFile.OpenAsync(FileAccessMode.Read)) { BitmapImage bitmapImage = new BitmapImage(); await bitmapImage.SetSourceAsync(fileStream); WriteableBitmap writeableBitmap = new WriteableBitmap(bitmapImage.PixelWidth, bitmapImage.PixelHeight); fileStream.Seek(0); await writeableBitmap.SetSourceAsync(fileStream); writeableBitmap = writeableBitmap.Crop(Convert.ToInt32(xValue), Convert.ToInt32(yValue), 100, 100); MagnifyTip.image1.ImageSource = writeableBitmap; 现在,MagnifyTip.image1具有一个设置为裁剪图像的图像源。 我的要求是缩放裁剪区域,然后将其指定给图像源。 用户控件看起来像这样 帮助将不胜感激