Coder Social home page Coder Social logo

andrewkirillov / aforge.net Goto Github PK

View Code? Open in Web Editor NEW
1.1K 104.0 488.0 20.66 MB

AForge.NET Framework is a C# framework designed for developers and researchers in the fields of Computer Vision and Artificial Intelligence - image processing, neural networks, genetic algorithms, machine learning, robotics, etc.

Home Page: http://www.aforgenet.com/framework/

License: Other

C++ 1.27% C 12.01% C# 86.25% Smalltalk 0.36% Inno Setup 0.05% Objective-C 0.04%

aforge.net's People

Contributors

anders9ustafsson avatar andrewkirillov avatar craigmillard avatar stefaj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aforge.net's Issues

ShapeChecker.IsQuadrilateral System.ArgumentOutOfRangeException

I am using AForge to detect rectangles on image and the method shapeChecker.IsQuadrilateral throws System.ArgumentOutOfRangeException.
I tracked the execution and it looks like the exception happens in method FindQuadrilateralCorners of class PointsCloud.
Specifically at this part of the code:

// sort other points in counter clockwise order
            float k1 = ( corners[1].X != corners[0].X ) ?
                ( (float) ( corners[1].Y - corners[0].Y ) / ( corners[1].X - corners[0].X ) ) :
                ( ( corners[1].Y > corners[0].Y ) ? float.PositiveInfinity : float.NegativeInfinity );

            float k2 = ( corners[2].X != corners[0].X ) ?
                ( (float) ( corners[2].Y - corners[0].Y ) / ( corners[2].X - corners[0].X ) ) :
                ( ( corners[2].Y > corners[0].Y ) ? float.PositiveInfinity : float.NegativeInfinity );

where it looks like the corners array has only two elements.
As in photo:
capture

Excessive occupancy of CPU

My computer processor is i5, and when I connect the 8 million pixel camera, CPU reaches 99%, how do I solve it?

Customize the HoughLineTransformation to use nonbinary image

Hi,
First thanks for the great library.
As far as I understand, the HoughLineTransformation takes a binary image as input. Binary means each pixel can have two value, 0 or 1. I have an anti-aliased line which i need to fed into the HoughLineTransformation. the edges are not 0 or 1, instead they have a value between 0 and 1. Can you please give me some guidance about how to customize the HoughLineTransformationin a way that it consider pixel value instead of 1 or 0. Or is it applicable and good idea at all? I need high precision specially for detecting anti-aliased lines.
Thanks

Frequent Crash with VideoFileWriter

Hi all
i get AccessViolationException occurred in AForge.Video.FFMPEG.dll .
it occurs randomly anytime between app start to 30mins.
even try catch block doesn't work. i'm running on x86 with .net framework v4.6 in C++/Cli

An unhandled exception of type 'System.AccessViolationException' occurred in AForge.Video.FFMPEG.dll Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Code:

 VideoFileWriter ^writer = gcnew VideoFileWriter();

 private: System::Void Video_Recorder_Tick(System::Object^  sender, System::Timers::ElapsedEventArgs^  e)
  {
      Bitmap^ save = ConvertMatToBitmap(image); //function to convert opencv's Mat to .net's Bitmap        
      if(writer!= nullptr)
       writer->WriteVideoFrame(save);
       delete save;
   }

  private: Void load_VideoWriter()
  {
    writer->Open("C:/video.avi", 640, 480, 10, VideoCodec::Default);        
  }

More Details here

is there a way to stop this error?
Thanks

Delay in preview of webcame, FPS drop on live preview and In video recording, video get pixelated when user select high resolution(1920 * 1080 : 60 FPS)

Issue 1: Delay in preview of webcam, FPS drop on live preview

On high resolution i am facing issue of delay in preview of webcam, FPS drop on live preview in AForge.Video.DirectShow(Version=2.2.5.0). I am using AForge.Video.DirectShow for getting camera feed in WPF c# application. On high resolution(1920 * 1080 : 60 FPS) user can observe delay in preview of webcam. On normal resolution preview is look good. But when user select higher resolution current frame rate is drooping and user can observe delay in preview of webcam.

This is event for get camera frame and assign to picture box and calculation for get framerate
image

Issue 2 video get pixelated when user select high resolution(1920 * 1080 : 60 FPS)

For video recording i have used Accord.Video.FFMPEG.VideoFileWriter(Version=3.8.0.0) package but in this video get pixelated when user select high resolution(1920 * 1080 : 60 FPS) In this screen shoot we can see that its pixelated video on high resolution(1920 * 1080 : 60 FPS)
image

This is normal preview from webcam where cant notice any pixelated feed on high resolution(1920 * 1080 : 60 FPS)
image

This is button click event where I am creating VideoFileWriter object for creating video
image

This is call-back event from AForge.Video.DirectShow library for getting each frame from webcam

image

I am not sure where i am doing wrong, Please let me know if I can overcome from this issue, Other suggestion is also welcome

Aforgenet.com is down

Go see for yourself. This is very unfortunate as it's the only source of API docs.

Need override for exclusion of 12bpp video capabilities

We're using a custom camera that has a lot of 8bpp video formats. In the latest build (2.2.5) any video capabilities with a bpp less than or equal to 12 are excluded. We need a way around this limitation. Perhaps a property we can set on the VideoCaptureDevice to show "all" capabilities?
Sorry about leaving a feature request as a bug, but this change has caused some major problems for us.

How do I add motion detection????

I wanted to add motion detection, so I had to add the reference "ref Bitmap image" but after adding that I get the error No overload for 'video_NewFrame' matches delegate 'NewFrameEventHandler'

        MotionDetector Detector;
        float viewmotion;
        private void mjpegStreamForm_Load(object sender, EventArgs e)
        {
            Detector = new MotionDetector(new TwoFramesDifferenceDetector(), new BlobCountingObjectsProcessing());
            viewmotion = 0;
        }
public void video_NewFrame(object sender, NewFrameEventArgs eventArgs, ref Bitmap image)     //<---------This is where I added it
       {
           viewmotion = Detector.ProcessFrame(image);

           time.Start();
           Bitmap img = (Bitmap)eventArgs.Frame.Clone();
           if (flag_rotate!=0)
           { 
           if (flag_rotate == 1) { img.RotateFlip(RotateFlipType.Rotate90FlipNone); }
           else if (flag_rotate == 2) { img.RotateFlip(RotateFlipType.Rotate180FlipNone); }
           else { img.RotateFlip(RotateFlipType.Rotate270FlipNone); }
           }
           if (flag_smooth == 1) { img = grayscale.Apply(img); }
           if (trackBar1.Value != 0) { img = br.Apply(img); }
           if (flag_flipX == 1) {img.RotateFlip(RotateFlipType.RotateNoneFlipX);}
           if (flag_flipY == 1) { img.RotateFlip(RotateFlipType.RotateNoneFlipY); }
           if (flag_sharpen == 1) { sharpen.ApplyInPlace(img);}
           if (flag_treshold == 1) {marker.ApplyInPlace(img); }
           if (flag_edge == 1) { rubovi.ApplyInPlace(img); }
           if (flag_dither == 1) {poster_filter.ApplyInPlace(img); }
           if (flag_invert == 1) { invert_filter.ApplyInPlace(img); }
           pbx_image.Image = img;
           time.Stop();
           lbl_time.Text = "Frame times: " + time.ElapsedMilliseconds+" ms";
           time.Reset();
       }

but on a button press I have the argument

        private void btn_playPause_Click(object sender, EventArgs e)
        {
            i++;
            if (i % 2 == 0)
            {
                this.btn_playPause.Image = ((System.Drawing.Image)(IPCams.Properties.Resources.icons8_circled_play_64));
                
                btn_capImage.Enabled = false;
                videoSource.SignalToStop();
                videoSource.WaitForStop();
                videoSource.Stop();
            }
            else
            {
                new Thread(() =>{
                Thread.CurrentThread.IsBackground = true;
                btn_capImage.Enabled = true;
                videoSource.Login = camUsername;
                videoSource.Password = camPassword;
                this.btn_playPause.Image = ((System.Drawing.Image)(IPCams.Properties.Resources.icons8_pause_button_64));
                videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame);        //<---------This is where I have the problem
                videoSource.Start();
                }).Start();
            }
        }

Is there any way to get rid of this error? I just want motion detection to work!

Redundant check on many PixelFormats

Dear Andrew,

There is no problem, but I just want reporting a redundant check on some methods, e.g. on abstract BlobCounterBase class:


public Blob[] GetObjects( UnmanagedImage image, bool extractInOriginalSize )
665 {
666 // check if objects map was collected
667 if ( objectLabels == null )
668 throw new ApplicationException( "Image should be processed before to collect objects map." );
669

670 if (
671 ( image.PixelFormat != PixelFormat.Format24bppRgb ) &&
672 ( image.PixelFormat != PixelFormat.Format8bppIndexed ) &&
673 ( image.PixelFormat != PixelFormat.Format32bppRgb ) &&
674 ( image.PixelFormat != PixelFormat.Format32bppArgb ) &&
675 ( image.PixelFormat != PixelFormat.Format32bppRgb ) &&
676 ( image.PixelFormat != PixelFormat.Format32bppPArgb )
677 )
678 throw new UnsupportedImageFormatException( "Unsupported pixel format of the provided image." );


On 673 and 675 lines.

Best the wishes,
Hashem.

Fix for Directshow Snapshot Capability Detection

HI,

i always got "no snapshots supported" for my Logitech c920 Webcam. It does not support external trigger but Software trigger, so the condition should be less restrictive:

in Directshow.VideoCaptureDevice

line 1100 the change should be
isSapshotSupported = ((caps & VideoControlFlags.ExternalTriggerEnable) != 0 );

to

isSapshotSupported = ((caps & VideoControlFlags.ExternalTriggerEnable) != 0 || (caps & VideoControlFlags.Trigger) != 0);

and boom - it works!

Приложение WPF падает при попытке создать объект класса VideoFileWriter

Привет. Отличный фреймворк получился, но я столкнулся с непонятной мне проблемой:
Компилирую под x86, запускаю на ПК с 64-разрядной осью (Win10 Home) - всё хорошо, запись с экрана сделал в файл avi.

Копирую приложение со всеми зависимостями на планшет с Win10 Home (x86), запускаю - падает на моменте создания объекта класса:
VideoFileWriter writer = new VideoFileWriter();

Никаких ошибок вообще нет, просто закрывается приложение. На двух машинах стоит 4-й .NET Framework. Есть какие-нибудь требования для нормального функционирования фреймворка? Например, набор библиотек C++?

Memory Leak

Hello,

I am using (Aforge, Aforge.Video and AForge.Video.FFMPEG) libraries to create video from IP camera stream but after a long time I have detected that the memory is going to up.

After i see this issue i wrote a new test program which is doing just creation video every 5 seconds. After 3000 videos memory is over 120 MB and the GC doesn't destroy unused variables.

This is my code;

        int i = 0;
        while (flagOfVideoCreator)
        {
            try
            {
                i++;

                string videoFilePath = "D:\\VideoPath\\" + i + ".avi";

                using (writer = new VideoFileWriter())
                {
                    writer.Open(videoFilePath, 640, 480, frameCountOneSecond, VideoCodec.MPEG4);

                    writer.Close();
                }

                Thread.Sleep(5000);

}
}

Adding Headers

Hi I've a web camera that's IP based. It's very old but does come with some software and that connects to it in a flash. Without and it's a tad sluggish.

Looking at the connection via fiddler and it adds these headers to the connection.

X-P2P-PeerDist: Version=1.1
X-P2P-PeerDistEx: MinContentInformation=1.0, MaxContentInformation=2.0
Accept-Encoding: peerdist

This doesn't seem to be an option in AForge, so I though I would try and get the source code and branch it, include the files and have a go. However TBH it just created all sorts of issues mainly around 'shim' and 'system.drawing' libraries.

Is there ay help that anyone can provide on this?
Thanks
Richard

Frame rate Accuracy

Cause m_framerate is int, VideoFileReader returns an inaccurate frame rate.
In VideoFileReader.cpp
int m_frameRate = data->VideoStream->r_frame_rate.num / data->VideoStream->r_frame_rate.den;
Though actual frame rate is 29.97, VideoFileReader.FrameRate returns 29 not 30.

In x64 mode, AForge.Video.VFW.AVIWriter.AddFrame() throws System.OverflowException

I really apricate to the developer of the useful software package AForge.NET.
I am using AForge.NET 2.2.5 (Full Zip Archive) with Visual Studio 2019 Pro.
When I select Any CPU mode, the following sample code works fine.
However, when I select x64 mode, the aviWriter.AddFrame() throws System.OverflowException: 'Arithmetic operation resulted in an overflow.'
Is there any way to avoid the error?

        AVIWriter aviWriter = new AVIWriter();
        Bitmap bitmap = new Bitmap(640, 360);
        Graphics g = Graphics.FromImage(bitmap);

        aviWriter.FrameRate = 30;
        aviWriter.Open("test.avi", 640, 360);

        for (int i = 0; i < 300; i++)
        {
            g.Clear(Color.Black);
            g.DrawString("" + i.ToString("d2"), new Font("MS UI Gothic", 64), Brushes.BlanchedAlmond, 10f, 10f);
            aviWriter.AddFrame(bitmap);
        }
        aviWriter.Close();

NewFrameEvent never fired when videoSource.Start() is called

I am using AForge in a console application, following the sample for snapshot capture. When I call videoSource.Start(), the method for handling the new video frame event is never hit. Here's the code:

static void video_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            // get new frame
            Bitmap bitmap = eventArgs.Frame;
            // process the frame
        }

        static void CameraSetup()
        {
            var videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            // create video source
            VideoCaptureDevice videoSource = new VideoCaptureDevice(videoDevices[0].MonikerString);
            Console.WriteLine(videoDevices[0].Name);
            // set NewFrame event handler
            videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame);
            // start the video source
            videoSource.Start();
            System.Threading.Thread.Sleep(10000);
            // ...
            // signal to stop when you no longer need capturing
            videoSource.SignalToStop();
            // ...
        }

NewFrame not getting called on OBS Virtual Camera

Hi I want to access to OBS Studio virtual camera using AForge.NET but it doesn't work properly.
It finds it and name and everything is fine but NewFrame is not getting called.
I tested the same code with my laptop webcam and it works...

namespace WebCamStudy
{
    class Program
    {
        static FilterInfoCollection filterInfoCollection;
        static VideoCaptureDevice videoCaptureDevice;
        static Viewer camView = new Viewer();

        static void Main(string[] args)
        {
            Console.WriteLine("Initializing...");
            /* ========================================================= */
            filterInfoCollection = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            foreach (FilterInfo Device in filterInfoCollection) Console.WriteLine($"Device [{Device.Name}]");
            var FilterInfo = filterInfoCollection[0]; // OBS Virtual Camera
            Console.WriteLine($"Connecting to [{FilterInfo.Name}]...");
            videoCaptureDevice = new VideoCaptureDevice(FilterInfo.MonikerString);
            videoCaptureDevice.NewFrame += OnFrameSync;
            videoCaptureDevice.Start();
            Console.WriteLine("Syncing...");
            camView.ShowDialog();

            /* ========================================================= */
            Console.WriteLine("Releasing...");
            if (videoCaptureDevice.IsRunning == true)
                videoCaptureDevice.Stop();
            camView.Close();
            Console.WriteLine("App finished.");
        }

        static private void OnFrameSync(object sender, NewFrameEventArgs eventArgs)
        {
            camView.SetFrame((Bitmap)eventArgs.Frame.Clone());
        }
    }
}

What is wrong?

  • Also there is no VideoSourceError

Frame Size and Video Resolution

I am using 4K webcam and trying to capture 4K image but make it stream on 1080p monitor.

By using your sample 'snap shot maker' on http://www.aforgenet.com/framework/samples/video.html,

4K image is shown in smaller box.

By using the VideoSourcePlayer.cs, however, 4K image is shown in the 3840x2160 itself, and I can see only edge of the image.

_videoSource.VideoResolution = videoCapabilities[comboBox1.SelectedIndex]; videoSourcePlayer1.VideoSource = _videoSource; videoSourcePlayer1.Start();

What kind of process I have to do? Do I need to convert bitmap size? Or changing frame size will work?

Thank you!

Camera lags for few seconds

Hi. I have followed samples for creating Camera capture WPF application. Everything works well, but the camera feed lags for couple of seconds which to me is a big no no since we need it for capturing snapshots. What I mean by lag, is when you move for example something in front of the camera, the camera shows the movement but delayed for ~ 2 seconds. Any help on the matter ?

Thanks

NewFrameEventHandler is not firing

I have an ASP.NET code that is using WinFroms, I am trying to capture images from the webcam.

I created a camera handler class as follows:

public static Bitmap img;
        public static void Initation()
        {
            VideoCaptureDevice video;
            FilterInfoCollection filter;
            try
            {
                filter = new FilterInfoCollection(FilterCategory.VideoInputDevice);
                video = new VideoCaptureDevice(filter[0].MonikerString);
                video.NewFrame += new NewFrameEventHandler(Camera_On);
                video.Start();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    private static void Camera_On(object sender, NewFrameEventArgs eventArgs)
    {
        img = (Bitmap)eventArgs.Frame.Clone();
    }
    public static string Save()
    {
        System.Drawing.Imaging.ImageFormat format = null;
        format = System.Drawing.Imaging.ImageFormat.Jpeg;
        string name = InitialSetup.currentLkr.Name + @"\" + InitialSetup.currentLkr.Name + "_" + DateTime.Now.ToString() + ".jpg";
        name = name.Replace(@"/", "_");
        name = name.Replace(" ", "_");
        name = name.Replace(":", "-");
        name = @"D:\" + name;
        img.Save(name);
        return name;
    }

I first call Initiate and then I call Save, the code was working fine, then suddenly the even handler stopped firing and I started to get null value in my img variable.

Any ideas on what might be the cause to that ?

DirectShow Media Control Crashes on x86

I'm posting to give more visibility to an issue my colleague posted on the official forums (http://www.aforgenet.com/aforge/forum/viewtopic.php?f=2&t=3552&p=10043#p10043).

Essentially, through a series of tests we've concluded that mediaControl.Run( ); https://github.com/andrewkirillov/AForge.NET/blob/master/Sources/Video.DirectShow/VideoCaptureDevice.cs#L1175

will crash if the videoCapabilities provided to GetPinCapabilitiesAndConfigureSizeAndRate https://github.com/andrewkirillov/AForge.NET/blob/master/Sources/Video.DirectShow/VideoCaptureDevice.cs#L1115 is NOT null.

To reproduce this, all you need to do is modify the Two Camera Test's MainForm.cs to include the following inStartCameras()`

   // Start cameras
        private void StartCameras( )
        {
            // create first video source
            VideoCaptureDevice videoSource1 = new VideoCaptureDevice( videoDevices[camera1Combo.SelectedIndex].MonikerString );
            //videoSource1.DesiredFrameRate = 10;

            // here we set a custom video resolution which will crash on x86
            var vcs = new List<VideoCapabilities>(videoSource1.VideoCapabilities);
            if (vcs.Count > 0) {
                    var vc = vcs[0];
                    //VideoSource in an instance of VideoCaptureDevice. Commenting out
                    //this line prevents the crash on x86 builds.
                    videoSource1.VideoResolution = vc;
            }

Interestingly, this only causes a crash on x86. If it's built for, and run, on x64, everything is fine.

As an aside - is this github repo more maintained than the official page http://www.aforgenet.com? I noticed the last build is 2013 but the forum there is somewhat up to date.

I noticed this repo is being managed by @andrewkirillov who, incidentally, authored the AForge.Video.DirectShow.Internals.IMediaControl file in question.

Thanks,
Travis

AForge.Video.DirectShow doesn't work when main project compiled as 64-bit

I'm using AForge.Video.DirectShow version 2.2.5 from NuGet. I have a Logitech HD Webcam C615 connected on a Windows 10 machine.

If I compile the main project as a x86 app, everything works fine. If I compile the main project as a x64 app, the following works normally,

  1. new FilterInfoCollection(FilterCategory.VideoInputDevice) returns all connected webcams.
  2. new VideoCaptureDevice() created the object correctly. All public properties seems right, including VideoCapabilities.

Calling the Start() method of a VideoCaptureDevice object will change its IsRunning property to True, but it does not trigger the NewFrame event.

Can't Serialize in UWP

It would be nice if this was fully compatible with UWP since in cant be serialized it isn´t much usefull on Windows universal apps... Not even Json.Net Serializer works to de-serialize the object, it only works to serialize it.

AForge.Video.DirectShow VideoCaptureDevice selectable SubType and 'raw' data mode

Currently the DirectShow VideoCaptureDevice will request RGB24 (or when available Mjpeg) MediaSubType. It would be great to be able to select the desired MediaSubType via properties. This however would be a problem if we try to convert some of the more obscure MediaSubType to Images. For this a 'raw' data mode could be added that simply passes the raw frame data as byte array instead of Image.

This would be useful for devices that have obscure MediaSubTypes or devices that send metadata within its image. E.g. thermal cameras, these often have a raw mode that sends raw sensor data instead of pixel values. That data can only be used properly if it remains in its original MediaSubType. If the original MediaSubType is e.g. YUY2 and we request RGB24, DirectShow will request YUY2 internally and convert to YUY2. This process involves rounding and is thus not reversible, rending the the data useless.

I would suggest to add two properties VideoCaptureDevice 'VideoFormat' and 'SnapshotFormat' typed with an Enum that holds different MediaSubTypes.
Since almost everything but RGB24 isn't 1:1 convertible to Image, these formats would have to be 'raw' mode only. For RGB24 and all other formats that can be converted to Image, I'd suggest for them to have an additional Enum value for when you'd like to get the raw data instead.
My idea for passing the raw data to the caller would be to extend NewFrameEventArgs with a RawData byte array property. The Frame property could be changed to be loaded 'lazy' when it is needed and would throw NotSupportedException if the data can't be converted to Image.

Please let me know if agree with my approach or if you would like to see it being done differently. I can then implement all the changes and open a pull request.

shapeChecker.IsConvexPolygon: long thin rectangle is not a convex polygon

executing following test fails:
It's about a long thin rectangle 50 high and 1000 wide.

2 bugs:

  • it is not recognized as convex
  • is only has 3 corners instead of 4.
 public class SimpleShapeCheckerTest
{
        private List<IntPoint> rectangledTriangle = new List<IntPoint>();
        public SimpleShapeCheckerTest()
        {
            longThinRectangle.Add(new IntPoint(0, 0)); //corner
            longThinRectangle.Add(new IntPoint(20, 0));
            longThinRectangle.Add(new IntPoint(40, 0));
            longThinRectangle.Add(new IntPoint(50, 0)); //corner
            longThinRectangle.Add(new IntPoint(50, 100));
            longThinRectangle.Add(new IntPoint(50, 500));
            longThinRectangle.Add(new IntPoint(50, 1000)); // corner
            longThinRectangle.Add(new IntPoint(25, 1000));
            longThinRectangle.Add(new IntPoint(0, 1000));
            longThinRectangle.Add(new IntPoint(0, 500));
         }

         [TestMethod]
        public void IsConvexPolygon()
        {
            List<IntPoint> corners;
            Assert.AreEqual(true, shapeChecker.IsConvexPolygon(rectangle, out corners));
            Assert.AreEqual(4, corners.Count);
        }

Migrate from packages.config to PackageReference

Hello,

I've tried to install the package in a Xamarin Android project, but I get the following error:

Package AForge 2.2.5 is not compatible with monoandroid81
(MonoAndroid,Version=v8.1).

After having described the problem on Stack and Xamarin forum, it seems that the problem comes from the new PackageReference.

Could you update your package?

VideoFileWriter in FFMPEG

Your video file writer in the FFMPEG library should accept a frame rate that has a double on it, not an int. The double is required because its rare that a frame rate doesn't have a decimal attached to it.

Issue with Video.FFMPEG's VideoFileWriter::close()

Hello,

I am using (Aforge, Aforge.Video and AForge.Video.FFMPEG) libraries to create video from sequence of image in c# but most of the time i get exception when i i call AForge.Video.FFMPEG.VideoFileWriter.Close() but not always. I have found fix for this here "https://code.google.com/archive/p/aforge/issues/406" but even after getting latest code with this fix. problem is still there.

A brief exception details are mentioned below:

Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at .avcodec_close(libffmpeg.AVCodecContext*)
at AForge.Video.FFMPEG.VideoFileWriter.Close()

Please let me know if any update on this bug or how can i catch this exception so that my windows service (C#) should not get crashed, i am having try catch block around "Forge.Video.FFMPEG.VideoFileWriter.Close()" but even though my service is getting crashed.

I am using two catch block
catch (System.Runtime.InteropServices.SEHException ex) {}
catch (Exception ex) {}

Thanks

Compilation errors

Andrew,

I am trying to compile the project my self. Needing to recompile Video.FFMPEG

I already installed 2008, 2010 and still missing AForge references.

I then included the project in the BuildAll solution and that took care of the references, but now receiving the following

Error 6 error C1859: 'Release\AForge.Video.FFMPEG.pch' unexpected precompiled header error, simply rerunning the compiler might fix this problem C:\Development\AForge.NET\Sources\Video.FFMPEG\AssemblyInfo.cpp 1 1 Video.FFMPEG

Any thoughts?

I would love it if you were able to create a small write up to get started compiling?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.