Giter VIP home page Giter VIP logo

sharpcv's Introduction

SciSharp STACK Web Portal

This repo contains the source code for http://scisharpstack.org

scisharp

Comprehensive list of all Projects

Stable or Beta

  • TensorFlow.NET .NET Standard bindings for TensorFlow
  • NumSharp Pure C# implementation of NumPy
  • Keras.NET Keras.NET is a high-level neural networks API for C#/F# with Python Binding and capable of running on top of TensorFlow, CNTK, or Theano.
  • Numpy.NET C#/F# bindings for NumPy - a fundamental library for scientific computing, machine learning and AI
  • ICSharpCore Jupyter kernel in C# .NET Core which is the standard interface for SciSharp STACK.
  • SharpCV A image library combines OpenCV and NumSharp together. SharpCV returns Mat object with NDArray supported.

Related technologies

  • .NET Interactive Notebooks Jupyter notebooks for C# and F#. Share code, explore data, write, and learn across your apps in ways you couldn't before.
  • Plotly.NET A .NET interface for plotly.js written in F#
  • Dash.NET A .NET interface to Dash- the most downloaded framework for building ML & data science web apps
  • FsLab An F# Community incubation space for data science

Referenced by:

gitMemory

sharpcv's People

Contributors

deep-blue-2013 avatar esther2013 avatar imporial avatar jiuyong avatar oceania2018 avatar pepure 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

sharpcv's Issues

Cannot convert OpenCvSharp.Mat to NumSharp.NDArray

This code works fine with SharpCV 0.7.0 but cannot compile with the newer versions:
Cannot implicitly convert type 'Tensorflow.NumPy.NDArray' to 'NumSharp.NDArray'

        public static NumSharp.NDArray _AsNDArray0(this OpenCvSharp.Mat mat)
        {
            return new SharpCV.Mat(mat.CvPtr).GetData();
        }

This is a 10 times slower alternative for the ones who have to use SharpCV > 0.7.0

       public static NumSharp.NDArray AsNDArray_slow(this OpenCvSharp.Mat mat)
        {
            var matType = mat.Type();
            var channels = mat.Channels();
            var size = mat.Rows * mat.Cols * channels;
            var shape = channels == 1 ? new Shape(mat.Rows, mat.Cols) : new Shape(mat.Rows, mat.Cols, channels);
            if (matType == MatType.CV_32SC1 || matType == MatType.CV_32SC2)
            {
                var managedArray = new int[size];
                Marshal.Copy(mat.Data, managedArray, 0, size);
                var aslice = ArraySlice.FromArray(managedArray);
                return new NumSharp.NDArray(aslice, shape);
            }
            if (matType == MatType.CV_32FC1)
            {
                var managedArray = new float[size];
                Marshal.Copy(mat.Data, managedArray, 0, size);
                var aslice = ArraySlice.FromArray(managedArray);
                return new NumSharp.NDArray(aslice, shape);
            }
            if (matType == MatType.CV_64FC1)
            {
                var managedArray = new double[size];
                Marshal.Copy(mat.Data, managedArray, 0, size);
                var aslice = ArraySlice.FromArray(managedArray);
                return new NumSharp.NDArray(aslice, shape);
            }
            if (matType == MatType.CV_8UC1 || matType == MatType.CV_8UC3 || matType == MatType.CV_8UC4)
            {
                var managedArray = new byte[size];
                Marshal.Copy(mat.Data, managedArray, 0, size);
                var aslice = ArraySlice.FromArray(managedArray);
                return new NumSharp.NDArray(aslice, shape);
            }

            throw new Exception($"mat data type = {matType} is not supported");
        }

Not working properly in F#

I'm trying to use F# with SharpCV but it throws an exception.

Sometime, the image file is loaded, but most of the functions I've tried to call throws a SEHException.

◢ | Results View | Expanding the Results View will enumerate the IEnumerable |  
  | Empty | "Enumeration yielded no results" | string

at SharpCV.cv2_native_api.imgproc_cvtColor(IntPtr src, IntPtr dst, Int32 code, Int32 dstCnt)
at SharpCV.cv_api.cvtColor(Mat img, ColorConversionCodes code, Int32 dstCnt)
at Program.main(String[] argv) in D:\projects\fs-sci\FlowerCv\FlowerCv\Program.fs:line 7

Please provide F# examples

Hello and thank you for creating SharpCV. Could you please provide a few F# examples in the readme? Because I'm having trouble getting SharpCV to work in F#. Thank you!

No method for Sobel

Hi,

Is there a way to apply Sobel operator to the image? I cant see any method for that.

BR\ Piyush

How to convert SharpCV Mat to OpenCVSharp Mat

Hi, There are few methods not available in SharpCV but present in OpenCVSharp.

Since SharpCV uses internally OpenCVSharp, is there a way we can convert SharpCV Mat to OpenCVSharp Mat?

Is sharpCV easy to port to other platforms than desktop? (Android / iOS/ linux-arm)

Hello,
Im working with some other opencv.net wrappers and currently eyeing this one to use it in XR experiments using Unity engine for easy graphics and physics.
Since mostly XR projects involve cordless and mobile devices and most of them are using ARM processors im asking if this library is flexible enough to be ported to other platforms.

Why GPL 3.0 ?

New OpenCV 4.50 is licensed under Apache 2.0 , older under BSD 3 clause, NumSharp under Apache 2.0 .
Why use one of the least favourite license of open source world? LGPL3 + static permissiveness would suffice.

Converting Python code into SharpCv

How can I convert the below python line into SharpCv:
np.column_stack(np.where(mat > 0))

I cant see column_stack method here, also the where method is not available.

Thanks in advance.

Initializing Mat object with 3 dimensional NDarray

I have a 250x250 image that is loaded into an NDArray that uses three channels, so the dimensions of the NDArray are (250, 250, 3).

It looks like the Mat object only takes in a 2D NDArray. Is there any way I can initialize a Mat object with this NDArray, or can it be added to the constructor for Mat to allow 3-Dimensional NDArrays?

Fody: Could not find 'System.Object'

I get the following error after installing SharpCV through the NuGet package manager in VS2019 upon building project. I replicated this twice. After uninstalling SharpCV, the error remains intact. Thanks!

Severity Code Description Project File Line Suppression State
Warning There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Tensorflow.Binding, Version=0.70.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=AMD64", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

Convert OpenCvSharp.Mat to Sharp.Mat and vice versa ?

The reason why i want to do this is because i like the "completeness" of OpenCvSharp compare to SharpCv and fantantic syntax/flexible of SharpCv when working with NDArray and Tensor. So i want to use OpenCvSharp to do all of the image processing stuff => convert OpenCvSharp.Mat to Sharp.Mat => working with NDArray/Tensor stuff. Any ideas ?

Implement imdecode

I have an image that is loaded in memory that I need to get into a Mat object.

Can cv2.imdecode() be implemented as it is in OpenCvSharp? It looks like this was already partly implemented in cv2_native_api.imgcodecs.cs with the imgcodecs_imdecode_vectors() method.

This would be simple to implement by adding the following to cv2,imgcodecs.cs

    public Mat imdecode(byte[] buf, IMREAD_COLOR flags = IMREAD_COLOR.IMREAD_COLOR)
    {
        cv2_native_api.imgcodecs_imdecode_vector(buf, new IntPtr(buf.Length), (int) flags, out var handle);
        return new Mat(handle);
    }

cv2.imgshow() not working

When you call the function it throws this error:

System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
   at SharpCV.cv2_native_api.highgui_imshow(String winName, IntPtr mat)
   at SharpCV.cv_api.imshow(String windownName, Mat img)

Example:
image

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.