aforge

Converting a thresholded image into a byte array?

大兔子大兔子 提交于 2019-12-14 00:00:25
问题 Can someone please tell me about how to convert a thresholded image stored in a 'Bitmap' variable into a byte array and view the byte array in a text box or a text file, in C#? Can someone please help me with the code to it? i have threshoded the image using Aforge.net - link. And trying to view the byte array of it in 1s and 0s. Thank you. 回答1: If your image is Bitmap you can use LockBits and then Scan0 methods: http://msdn.microsoft.com/query/dev11.query?appId=Dev11IDEF1&l=EN-US&k=k(System

aforge image comparison with UWP

回眸只為那壹抹淺笑 提交于 2019-12-13 05:36:13
问题 I'm using portable.aforge.imaging for image comparison on a UWP project. The method ProcessImage requires Bitmap type as arguments. I'm using System.Drawing to access Bitmap class, but i'm getting errors when i try to instantiate: "Bitmap does not contains a constructor that takes 1 argument" Does regular Bitmap class is available on UWP? if yes, what am i doing wrong? if not, what alternatives do i have to use the aforge's ProcessImage for comparison? private void TestAForge() {

How to set video resolution?

三世轮回 提交于 2019-12-12 10:01:46
问题 I'm working with aForge and I'm attempting to set the resolution for a video feed from an USB webcam so it fits properly in a pictureBox. I'm aiming for a resolution of 800x600, but the default resolution I get is about 640x480. When I try to set the resolution, I get the message that "members of readonly field cannot be modified". Does anyone with experience with aForge have any ideas/a solution? 回答1: Exactly: the desiredFrameSize property is obsolete. You must use the VideoResolution

image processing recognizing object digit

走远了吗. 提交于 2019-12-12 03:56:43
问题 need help with implementation on recognizing characters from a image. for example i have how to recognize 142 489 1. to make images for every digit, map 0 -> [images like 0], 1 -> like 1... and so on. 2. to make only lines of image, i mean and compare with images in case 1, or with "skelet" in case 2. how to implement one of this methods? using Aforge in c#; 回答1: This is not a trivial problem so you may be better to examine an existing implementation like the .NET wrapper for Tesseract. 来源:

MJPEGStream Display Stream Aforge.Video.dll

余生颓废 提交于 2019-12-12 00:07:43
问题 I'm trying to stream an IPCAM D'Link using the Aforge Libraries but i'm not succeed: I want to display the video stream into an PB control. My Code: Imports AForge.Video Public Class Form1 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Try Dim stream As New MJPEGStream("http://190.6.198.3/video/mjpg.cgi") stream.Login() = "admin" stream.Password() = "" stream.Start() Catch ex As System.Net.WebException MsgBox(ex.Message.ToString) End Try End Sub End

AForge - Working with video card with multiple cameras

北战南征 提交于 2019-12-11 10:57:08
问题 I can get AForge to work with an USB web cam, but I have a video card that can connect to multiple cameras. How do I get AForge to work with the video card? My issue is I could not get the VideoInputDevice to set to a working video input. The code is like this: void init(){ FilterInfoCollection videoCaptureDevice = new FilterInfoCollection(FilterCategory.VideoInputDevice); VideoCaptureDevice finalVideo = new VideoCaptureDevice(videoCaptureDevice[0].MonikerString); finalVideo.NewFrame += new

AForge Image Processing exception

馋奶兔 提交于 2019-12-11 07:18:32
问题 I'm trying to use the algorithms of AForge library seen in this little example to find an image inside an image, the code of that example works perfectlly ...but to finish the comparission (find 50x50px in 1920x1080px) it takes forever, so I would like to resize the images to gain speed... From this: Dim sourceImage As Bitmap = Bitmap.FromFile("C:\1.bmp") Dim template As Bitmap = Bitmap.FromFile("C:\2.bmp") To this else: Dim sourceImage As Bitmap = ResizedBitmap1 Dim template As Bitmap =

Prevent OutOfMemoryException With AForge and Graphics.FromImage.DrawImage

不打扰是莪最后的温柔 提交于 2019-12-11 03:43:16
问题 I have written a code to allow the user to start and stop a feed from their webcam. I have used AForge.NET's NewFrameEventArgs to update a PictureBox with the new frame each time it changes. Everything works perfectly however whenever I start the feed, the RAM usage on my computer slowly goes up until an OutOfMemoryException occurs. Please could you help me find out how to clear or flush this somehow. When I get the exception, it occurs at the bottom of the code in ScaleImage: System.Drawing

Synchronize video subtitle with text-to-speech voice

亡梦爱人 提交于 2019-12-10 02:56:32
问题 I try to create a video of a text in which the text is narrated by text-to-speech. To create the video file, I use the VideoFileWriter of Aforge.Net as the following: VideoWriter = new VideoFileWriter(); VideoWriter.Open(CurVideoFile, (int)(Properties.Settings.Default.VideoWidth), (int)(Properties.Settings.Default.VideoHeight), 25, VideoCodec.MPEG4, 800000); To read aloud the text I use SpeechSynthesizer class and write the output to a wave stream AudioStream = new FileStream(CurAudioFile,

How to Extract Front Shape in an Image in C#

萝らか妹 提交于 2019-12-08 12:36:49
问题 Is it possible to Extract any Shape that's in front of an image? let's say we have an image of two objects 1 in front, the other is behind and a blank or transparent background. can we extract the one in front and place it in a new image? can this be done by detecting edge of frontal shape and then crop it? This article is doing something near to my question : Cropping Particular Region In Image Using C# but i want to do it fully automated. any help would be highly appreciated. Thanks in