Coder Social home page Coder Social logo

cloudcv / cloudcv-bootstrap Goto Github PK

View Code? Open in Web Editor NEW
75.0 21.0 21.0 19.45 MB

A starter template for Node.js with OpenCV bindings. This project lets you to quickly prototype a REST API in a Node.js for a image processing service written in C++.

License: BSD 3-Clause "New" or "Revised" License

JavaScript 54.26% C++ 33.98% Python 2.64% CSS 2.04% HTML 7.08%

cloudcv-bootstrap's Introduction

CloudCV Boostrap

CloudCV Boostrap

A starter template for Node.js with OpenCV bindings.

Build Status

This project lets you to quickly prototype a REST API in a Node.js for a image processing service written in C++.

Installation

# Get the latest snapshot 
$ git clone —depth=1 --branch 0.0.1 https://github.com/CloudCV/cloudcv-bootstrap.git myproject
$ cd myproject 
$ git remote rm origin 

# Install NPM dependencies 
$ npm install

# Start local server
$ npm start

After starting local webserver, navigate to http://localhost:3000 where you should see similar page:

Website

Here you can drop arbitrary image to extract dominant colors using REST-API.

Quick start

npm start

Unit testing

npm test

Questions?

Explore the series of blog posts:

  1. https://computer-vision-talks.com/introducing-cloudcv-bootstrap/
  2. https://computer-vision-talks.com/marshalling-data-in-nodejs-c-modules/
  3. https://computer-vision-talks.com/how-to-debug-nodejs-addons-in-visual-studio/

CloudCV bootstrap is free software/open source, and is distributed under the BSD license. It contains third-party code, see the included third-party.txt file for the license information on third-party code.

CloudCV bootstrap is created and maintained by Eugene Khvedchenya (Twitter: @cvtalks). Follow the official Twitter stream @cvtalks to get the frequent development updates.

cloudcv-bootstrap's People

Contributors

bloodaxe 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

Watchers

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

cloudcv-bootstrap's Issues

Problems with CORS

Hi,
I am experiencing problems with Cross-Origin Request Blocked. I am getting the following error from the console.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://45.55.223.62:3000/api/v1/image/analyze/dominantColors/?image=http%3A%2F%2F45.55.223.62%3A8888%2Fimages%2Fmandrill.png. This can be fixed by moving the resource to the same domain or enabling CORS.

My header response is:
Connection: keep-alive
Content-Type: application/json
Date: Thu, 14 May 2015 06:04:28 GMT
Transfer-Encoding: chunked
X-Powered-By: Express

Any idea what that could be?
Cheers,
Michel

Build Error: No Matching Function for Call to v8::Signature ::New(v8::Isolate*, NanIntern::Factory<v8::Signature>::FTH&, int&, NanIntern::Factory<v8::Signature>::FTH*&)

Hi All,

I am very much new to nodejs and npm and want to make a webapp for an image processing algorithm. For the same, I want to use this template of cloudcv-bootstrap and hence, I carried the install procedure as was mentioned. My verisons are as follows:

node -- 4.2.3
npm -- 2.14.7
nodejs -- 0.10.25

When I ran npm install, it starts building after installing all the dependencies. However, I got the following errors:

make: Entering directory `/home/kinoder/ws/cloudcv-bootstrap/build'
CXX(target) Release/obj.target/cloudcv/src/cloudcv.o
In file included from ../node_modules/nan/nan_new.h:190:0,
from ../node_modules/nan/nan.h:80,
from ../src/cloudcv.cpp:14:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static NanIntern::FactoryBasev8::Signature::return_t NanIntern::Factoryv8::Signature::New(NanIntern::Factoryv8::Signature::FTH, int, NanIntern::Factoryv8::Signature::FTH_)’:
../node_modules/nan/nan_implementation_12_inl.h:181:76: error: no matching function for call to ‘v8::Signature::New(v8::Isolate_, NanIntern::Factoryv8::Signature::FTH&, int&, NanIntern::Factoryv8::Signature::FTH_&)’
return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);
^
../node_modules/nan/nan_implementation_12_inl.h:181:76: note: candidate is:
In file included from /home/kinoder/.node-gyp/4.2.3/include/node/node.h:42:0,
from ../node_modules/nan/nan.h:24,
from ../src/cloudcv.cpp:14:
/home/kinoder/.node-gyp/4.2.3/include/node/v8.h:4675:27: note: static v8::Localv8::Signature v8::Signature::New(v8::Isolate_, v8::Localv8::FunctionTemplate)
static Local New(
^
/home/kinoder/.node-gyp/4.2.3/include/node/v8.h:4675:27: note: candidate expects 2 arguments, 4 provided
In file included from ../src/cloudcv.cpp:14:0:
../node_modules/nan/nan.h: At global scope:
../node_modules/nan/nan.h:171:25: error: redefinition of ‘template v8::Local NanEnsureLocal(v8::Local)’
NAN_INLINE v8::Local NanEnsureLocal(v8::Local val) {
^
../node_modules/nan/nan.h:166:25: error: ‘template v8::Local NanEnsureLocal(v8::Handle)’ previously declared here
NAN_INLINE v8::Local NanEnsureLocal(v8::Handle val) {
^
../node_modules/nan/nan.h:564:13: error: ‘node::smalloc’ has not been declared
, node::smalloc::FreeCallback callback
^
../node_modules/nan/nan.h:564:35: error: expected ‘,’ or ‘...’ before ‘callback’
, node::smalloc::FreeCallback callback
^
../node_modules/nan/nan.h: In function ‘v8::Localv8::Object NanNewBufferHandle(char
, size_t, int)’:
../node_modules/nan/nan.h:568:50: error: ‘callback’ was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^
../node_modules/nan/nan.h:568:60: error: ‘hint’ was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^
../node_modules/nan/nan.h: In function ‘v8::Localv8::Object NanNewBufferHandle(const char
, uint32_t)’:
../node_modules/nan/nan.h:575:67: error: call of overloaded ‘New(v8::Isolate
, const char&, uint32_t&)’ is ambiguous
return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
^
../node_modules/nan/nan.h:575:67: note: candidates are:
In file included from ../node_modules/nan/nan.h:25:0,
from ../src/cloudcv.cpp:14:
/home/kinoder/.node-gyp/4.2.3/include/node/node_buffer.h:31:40: note: v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate_, v8::Localv8::String, node::encoding)
NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate_ isolate,
^
/home/kinoder/.node-gyp/4.2.3/include/node/node_buffer.h:31:40: note: no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/kinoder/.node-gyp/4.2.3/include/node/node_buffer.h:43:40: note: v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate_, char_, size_t)
NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate* isolate,
^
/home/kinoder/.node-gyp/4.2.3/include/node/node_buffer.h:43:40: note: no known conversion for argument 2 from ‘const char_’ to ‘char_’
In file included from ../src/cloudcv.cpp:14:0:
../node_modules/nan/nan.h: In function ‘v8::Localv8::Object NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:579:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocalv8::Object’ to ‘v8::Localv8::Object’
return node::Buffer::New(v8::Isolate::GetCurrent(), size);
^
../node_modules/nan/nan.h: In function ‘v8::Localv8::Object NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:586:12: error: ‘Use’ is not a member of ‘node::Buffer’
return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
^
Is there anything that I can do to resolve this issue ?

Suggestion for increased usage of this concept using API client/server generators

I was thinking after finding this project that it is a great idea, and wondered if you thought it might be a good idea to write a Swagger spec for the API, so that you could from automatically generate a variety of different types of servers and clients for a large number of available programming languages. I am not 100% sure what would be involved in the process of generating bindings for OpenCV for each language, but I do know many different bindings exist that could be adapted for this purpose.

This would make the project interesting for a wider audience. If you feel this is worth investigating further I will start doing some research and see what all would be necessary. I am fairly new to Swagger and OpenCV, but I learn quick.

Independent NanCheck

Would it be possible to create a new project just for NanCheck?

I think it would be really interesting for people building node.js addons.

Error compiling

Error compiling:

  cloudcv.cpp
  ImageView.cpp
  Job.cpp
  Algorithm.cpp
C:\dev\cloudcv-bootstrap\src\framework/marshal/opencv.hpp(51): error C2766: explicit specialization; 'Nan::marshal::Serializer<std::string>' has a
lready been defined (compiling source file ..\src\framework\ImageView.cpp) [C:\dev\cloudcv-bootstrap\build\cloudcv.vcxproj]
  C:\dev\cloudcv-bootstrap\node_modules\nan-marshal\nan-marshal.h(252): note: see previous definition of 'Serializer<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >' (compiling source file ..\src\framework\ImageView.cpp)

Interactive Background removal

Hey currently i am working on a background removal feature i have already implemented in opencv using grabcut but for the web thing i wonder how could i use your cloud cv to integrate opencv libraries ?? Reply Asap!!nks
Thanks!

Incorrect display in we browser.

Hi,
Thank you for cloudcv-bootstrap.
I am unable to generate the sample output (dominant colors palette display) on a web broswer
Wondering if the latest release broke some code?

Also, using curl localhost:3000/api/v1/image/analyze/dominantColors?image=opencv-logo.jpg is returning json formatted dominant color output as explained.

-Satish.

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.