Giter VIP home page Giter VIP logo

ofxedsdk's Introduction

ofxEdsdk

ofxEdsdk requires the EDSDK library from Canon.

ofxEdsdk was developed with support from YCAM http://www.ycam.jp/

Installation/Usage

  1. Apply for a developer's license from Canon's website
  2. After you have been approved (can take anywhere from minutes to a day or two), follow the download instructions included in your confirmation email from Canon.
  3. Clone this repo, or download this repo as a zip file, unzip, and place contents in your addons folder. If downloading, edit the folder name so that it only says "ofxEdsdk".
  4. Open the Canon EDSDK .dmg image.
  5. Copy the EDSDK/Header/EDSK*.h files into the directory openFrameworks/addons/ofxEdsdk/libs/include/
  6. Copy the EDSDK/Framework/*.framework files into the directory openFrameworks/addons/ofxEdsdk/libs/lib/
  7. Open the OF Project Generator application and build a new app, including the ofxEdsdk addon.
  8. In the new project, go to the project Build Settings and add ../../../addons/ofxEdsdk/libs/EDSDK/lib to Framework Search Paths.

Following these steps will include Canon's developer library and this wrapper for all its functions for use in OF. You should be able to run the blank project successfully.

ofxEdsdk is tested with Canon SDK 3.6, on macOS 10.11-10.13 and Windows 8.1 with openFrameworks 0.9.2 and up.

ofxedsdk's People

Contributors

bangnoise avatar dewb avatar elliotwoods avatar jocabola avatar kylemcdonald avatar matthewepler avatar roymacdonald avatar smallfly 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

ofxedsdk's Issues

compile problem on OSX 10.8.2

Hi
I found compile problem with EDSDK 2_13 on OSX.
The reason of it is the source, ofxEdsdk.cpp includes some Obj-C lines.
So solution for this is just rename the file into ofxEdsdk.mm.

I forked the project here
But I'm afraid you need rename the file back to ofxEdsdk.cpp when using on WIN.

thanks for great addon!

VS2015 linker error

Hey everyone,
i'm very new to using oF in VS and want to check out ofxEdsdk, but i can't run any project since i keep on getting Linker errors like

LNK2019
unresolved external symbol __imp__EdsInitializeSDK@0 referenced in function "void __cdecl Eds::InitializeSDK(void)" (?InitializeSDK@Eds@@YAXXZ)

I applied for the canon EDSDK and downloaded it and copied the EDSDK-folder into OF > addons > ofEdsdk > src, allthough it seems to me as if this install instruction is meant for OSX only...
Any idea how i need to progress from here? Where should i place the files? Or am I just missing any includepaths for linking somewhere? Thanks a lot

waitForThread() is never ending

With OF 0.8.4, OSX.8.5, EOS 600D
The first time the example runs successfully.
When I tried to stop it won't stop and is never ending the waitForThread() function of the destructor. In the console you can read :
[verbose] ofThread: - name: Thread 1 - External thread unlocked the ofThread mutex.
[verbose] ofThread: - name: Thread 1 - ofThread waiting for its own mutex to be unlocked.
[verbose] ofThread: - name: Thread 1 - ofThread locked its own mutex.
[verbose] ofThread: - name: Thread 1 - ofThread unlocked its own mutex.
[verbose] ofThread: - name: Thread 1 - Signaled to stop.
[verbose] ofThread: - name: Thread 1 - waiting to stop

I had to force the application to quit. The second time it won't run and the console says :
[verbose] ofThread: - name: Thread 1 - Started Thread.
[verbose] ofThread: - name: Thread 1 - ofThread waiting for its own mutex to be unlocked.
[verbose] ofThread: - name: Thread 1 - ofThread locked its own mutex.
[ error ] There was an error opening the camera, or starting live view: EDS_ERR_COMM_PORT_IS_IN_USE inside OpenSession()
[verbose] ofThread: - name: Thread 1 - Thread Finished.

I had to restart the computer.

When I comment the waitForThread() function and add a stopThread() function (it's the same without the stopThread() function), there is no hanging at exit of the application and the console says :
[[verboseverbose] ] ofThreadofThread: : - name: Thread 1 - External thread unlocked the ofThread mutex.- name: Thread 1 - ofThread locked its own mutex.

[verbose] ofThread: - name: Thread 1 - ofThread unlocked its own mutex.

kEdsCameraCommand_PressShutterButton

I am trying to implement two commands:

Eds::SendCommand(camera, kEdsCameraCommand_PressShutterButton, kEdsCameraCommand_ShutterButton_Completely);
and
Eds::SendCommand(camera, kEdsCameraCommand_PressShutterButton, kEdsCameraCommand_ShutterButton_OFF);

This will make it possible to do arbitrarily long exposures in Bulb Mode.

It works pretty well using the structure already set up in the Camera class using a flag to execute the command in the captureLoop. However, after the I "release" the shutter, it seems to get stuck in an endless loop of taking photos, and I'm not sure why.

Any tips would be appreciated! Working towards a PR with the new "pressShutter" and "releaseShutter" functions.

VS2015 linking error

Hey everyone,
i'm very new to using oF in VS and want to check out ofxEdsdk, but i can't run any project since i keep on getting Linker errors like

LNK2019
unresolved external symbol __imp__EdsInitializeSDK@0 referenced in function "void __cdecl Eds::InitializeSDK(void)" (?InitializeSDK@Eds@@YAXXZ)

I applied for the canon EDSDK and downloaded it and copied the EDSDK-folder into OF > addons > ofEdsdk > src, allthough it seems to me as if this install instruction is meant for OSX only...
Any idea how i need to progress from here? Where should i place the files? Or am I just missing any includepaths for linking somewhere? Thanks a lot

no DPP.framework in newest edsdk

Thanks for this. I can't seem to find the DPP.framework in the most recent sdk (3.2). Any idea where I can find version 2.14?

OF Project Generator not working

Hi,

Env: MacOS 10.9.1
Dev env : XCode 5.0.2
Of: 0.8.0
Edsdk 2.13

I have not been able to create a new project using the project generator.
It first creates the project folder in myApps and then nothing else happens (app busy).
I have to force to quit the app.
I tried with other add-ons and it works fine.

When opening the project, it doesn't contain any reference to the add-on so I suppose something bad happens during the project generation.

EDSDK is not compatible with macOS 10.15

I don't know if this is published officially anywhere, but I've personally received info from Canon saying that EDSDK 13.11.10 (and presumably all previous versions) are not compatible with macOS 10.15.

Can't run a basic example on OSx

Hi guys,

I am trying to run a basic example using Cannon 5D Mark II

I made a new project using the ProjectGenerator, including the ofxEdsdk addon.

My ofApp.h file looks like this:

#pragma once

#include "ofMain.h"
#include "ofxEdsdk.h"

class ofApp : public ofBaseApp{

public:
void setup();
void update();
void draw();

ofxEdsdk::Camera camera;
    
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void mouseEntered(int x, int y);
void mouseExited(int x, int y);
void windowResized(int w, int h);
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);

};

When I run this code gives this errors:

screen shot 2017-03-12 at 1 24 47 pm

Do you have any clue of what could be happening here?

The versions I am using are this:
Openframework v 0.9.8
OSx El Capitan 10.11.4 beta
EDSDK version 3.4.20.5, Copyright 2016 Canon Inc.

License

Could you provide a license for the project? e.g. MIT, BSD.

Support for OSX v2.12?

Hey there, I just got EDSDK 2.12 installed and it recognizes that a camera is attached but then hangs indefinitely. I tried the sample programs included with the sdk and they worked nicely. Before I dig too far, do you have any tips on what to check first?

Library not loaded

Hi, I have a runtime error:
dyld: Library not loaded: @executable_path/../Frameworks/DPP.framework/Versions/A/DPP
Referenced from: /Users/rodrigo/Herramientas/of_v0.8.4_osx_release/apps/myApps/FanDelArte/bin/FanDelArte.app/Contents/MacOS/FanDelArte
Reason: image not found

I'm running
OSX 10.9.5
Xcode Version 6.0.1 (6A317)
of_v0.8.4

¿Any thoughts?

OFX_EDSDK_MOV_FORMAT is changed for new ED-SDK 3.2

Sorry, this is a duplicate of #34
In ofxEdsdk.cpp, the number has changed

define OFX_EDSDK_MOV_FORMAT 45317 //old number is 45316

This makes the video file never get saved.
Maybe should consider using "if, else" instead of "if, else if" to catch all numbers.
But maybe it is camera dependent. I'm using 700D.

Live View performance (EDSDK v3.2)

Hi,

Following are the performances I get running the example on both OS X 10.11.2 and Windows 10 with OF master branch and EDSDK v3.2.

OS X (both 32bit and 64bit)
Canon Rebel T6s
App 60 fps
Cam Live View 29 fps
Bandwidth 4.7 MiB/s
(Notes: the EDSDK v3.2 crashes really often on OS X with this camera - see #41)

Canon Rebel T1i
App 60 fps
Cam Live View 29 fps
Bandwidth 3.7 MiB/s

Windows (both 32bit and 64bit on two different Windows computers)
Canon Rebel T6s
App 59 fps
Cam Live View 9 fps
Bandwidth 0.8 MiB/s

Canon Rebel T1i
App 59 fps
Cam Live View 10 fps
Bandwidth 1.1 MiB/s

Would someone have an idea why there is so much difference between OSX and Windows?
Does someone get different results with the same setups?

As already discussed in the issue #27 I tried using libjpeg-turbo via ofxTurboJpeg but this time the performances are quite similar.

Using EOS Utility 3.3.0, I get a Live View at ~30fps on both OS X and Windows and for both cameras.
With OF 0.8.4 and EDSDK v2.14, the T1s Live View was around 30 fps and at that time the T5i was ~20fps (on both OS X and Windows).

Thanks

Auto Focus

Not an issue, but I added some logic to your magic to make the camera try to focus before taking a picture (the equivalent of pressing the shutter button down halfway).

You can see the diff here.

If this is something you might want in the addon we can negotiate a PR (what I mean is: I might need to clean up the code, or make it more understandable, or merge my takePhotoAF() function into takePhoto() : )

Let me know.

Error in dll when compiling

I'm running on Windows 7 64-bit, VS 2012, oF 0.8.4, and EDSDK 3.2. Everything in the example project seems to compile until it gets to the EDSDK dlls, when it throws a bunch of errors about unknown characters and such. I added the output of VS console to a pastebin since it's a bit long. Any thoughts? I was going to try downgrading SDK but I can't seem to find download link for the version you mentioned, so I'd have to google a download.

pastern.com/uAqeAbnf

problems disconnecting camera on exit

Hey there,

when I try to call Camera::close() the program stucks.

Camera::stopCapture() stucks when called.

I had a look inside the method and Eds::EndLiveview(camera); is called and then stucks.
Also when uncommenting the liveView part it stucks at Eds::CloseSession(camera);

Someone has any idea?

sleep !

the cam thread is mad heavy, and an app that uses it slows down, alot. how about something like,

ofSleepMillis(30);

in the thread loop, or anything even? I get significant improvements to my main app adding some sort of sleep in the loop of the thread. not having any sleep is bad for an OF that uses this app's thread performance, as it's really battling for cycles.

Live view processing performance.

Hi,

How could we make this faster?
The ofLoadImage() call is the one demanding the most part of the processing time.
Would ofxCV be of help for this?

lock();
if(liveBufferMiddle.size() > 0) {
    // decoding the jpeg in the main thread allows the capture thread to run in a tighter loop.
    ofBuffer* middleFront = liveBufferMiddle.front();
    liveBufferFront.set(middleFront->getBinaryBuffer(), middleFront->size());
    liveBufferMiddle.pop();
    unlock();
    ofLoadImage(livePixels, liveBufferFront);
        livePixels.rotate90(rotateMode90);
    if(liveTexture.getWidth() != livePixels.getWidth() ||
        liveTexture.getHeight() != livePixels.getHeight()) {
        liveTexture.allocate(livePixels.getWidth(), livePixels.getHeight(), GL_RGB8);
    }
    liveTexture.loadData(livePixels);
    lock();
    liveDataReady = true;
    frameNew = true;
    unlock();
} else {
    unlock();
}

Thanks

error when downloading large videos

MyApp(37848,0xb0536000) malloc: *** mach_vm_map(size=1753378816) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

this happens in Eds::DownloadImage > Eds::CopyStream when the video gets above a certain number of MB. I think it's around 450MB...

Still looking into it, but has anyone else encountered this problem?

EDSDK v2.15 / OS X 10.10.4 / 5D Mark III

camera.drawPhoto not working in the example

In the draw method I uncommented the camers.drawPhoto call in order to see the captured photo and not the liveview, but when I make a new capture it just draws a white square.
The image file is save correctly by the camera.savePhoto(ofToString(ofGetFrameNum()) + ".jpg"); call so I think that the problem doesn´t comes from EDSDK and is just related to the camera.drawPhoto implementation.

Here is the change from the example code
void testApp::draw() {
//camera.draw(0, 0);
camera.drawPhoto(0, 0, 432, 288);

And the screen capture
captura de pantalla 2013-09-20 a la s 07 27 16

I used EDSDK v2130 on Mountain Lion

live view isn't optional

I like the wrapper around the SDK, but I don't always want to have live view enabled. It would be nice to be able to easily turn live view on and off easily.

I have a (crappy) patch in progress for this that I'll try to tidy up and get out for review shortly.

Compilation error.

Hi,
So I wanted to try out controlling a Canon EOS camera with openframeworks, sadly it didn't work. I have tried two official canon SDK versions (2.11 and 3.14), with openframeworks 0.9.0 and 0.9.3, on both windows 7 and windows 8. None of them got through the compilation, yet all of them showed the same error messages: Unknown characters, syntax error, character not allowed, etc. It just seemed like that the SDK, ofxEdsdk and openframeworks were totally incompatible. I have followed the steps included, and tried both blank projects and examples. All ended up the same. Think anyone has any idea?
Thanks,
Kaun

LiveView stalled after taking picture

I have a problem with ofxEDSDK and my Canon 500D. Live view is working fine but when I call takePhoto() the live view is stalled even after I download the image.

Does anyone have this issue? Any workaround?

Thanks

CoreVideo framework necessary?

I didn't know if this was a problem with my system setup, oF setup, or addon setup, but I need to add the CoreVideo framework to be able to compile the example project. Should I submit a pull request with the CoreVideo framework added? Or is there some more basic configuration that I have mis-matched to other people?

Problem addons in VS 2015 / Windows 10

Hi, I have this error:

Severity Code Description Project File Line Suppression State
Error C4716 'ofxEdsdk::Camera::close': must return a value mySketch
c:\users------\of\windows\of_v0.9.0_vs_release\addons\ofxedsdk\src\ofxedsdk.cpp 109

Current HEAD doesn't build

Testing with:

  • oF current master branch
  • ofxEdsdk master branch
  • OSX 10.8
  • Canon EOS Kiss X7 (EOS 100D)

I get a lot of NSObject errors:
image

Semi-fix is to git checkout HEAD~3, but then the camera doesn't initialise, but that could be a library-camera compatibility issue

Compile error OS X on nightly build

Hi,
when I try to compile the addon with the latest nightly build on osX el capitan a linker error occurs:
ld: framework not found EDSDK clang: error: linker command failed with exit code 1 (use -v to see invocation)

I included the .framework files in the project. The target membership is set as required . So I do not have any idea what could be the reason.

EDSDK v3.2 crashes on OS X

Hi,

9 times out of 10, the EDSDK v3.2 crashes when trying to open a session with the Rebel T6s. It tries to access a deallocated instance. The same versions of the add-on and EDSDK work fine with the Rebel T1i and the Rebel T5i.

Here is the message when enabling the Zombie mode in Xcode:

exampleDebug[1506:66502] *** -[CFDictionary objectForKey:]: message sent to deallocated instance 0x600000061280

Am I correct to think that this is a Canon issue and that nothing can be done on the OF side?
I even have sent a quick email to Canon about this, but they do not give any support on the EDSDK.

Thanks

no known conversion from 'ofxEdsdk::Camera' to 'cv::Mat &'

Hi folks,

I'm stuck trying yo get a cv::Mat format from the camera Cannon Mark II image.

The basic example from ofxEdsdk works, but when I try to use it inside a project for FaceTracking I can't apply the toCv() method, throw the error 'No matching function for call to 'toCv'

void ofApp::update() {
	cam.update();
	if(cam.isFrameNew()) {
        
        cv::Mat imgMat = toCv( cam ) //<-
        camTracker.update(imgMat);
      .
      .
      .

This code works with a webcam, I think the key to solve this problem is in this sentence from Xcode:
'Candidate function not viable: no known conversion from 'ofxEdsdk::Camera' to 'cv::Mat &' for 1st argument

is kinda obvious the error is there but i just can't solve this! I'v been trying for weeks!. I hope some of you could help me.

App crash on startup when calling OpenSession(EdsCameraRef inCameraRef)

Hey,

I wanted to update an old project that was using this addon. I realised that when starting my app or your example it crashed in the function:

void OpenSession(EdsCameraRef inCameraRef) {EdsError err = EdsOpenSession(inCameraRef); if(err != EDS_ERR_OK) {throw Exception(err, "OpenSession");}}

(Located in EdsWrapper.cpp)

I tried the trick described in the readme here: https://github.com/wouterverweirder/ofxCanonEOS
I replaced the current SDK with the one found in EOS Utility app.

Then the app launch correctly and work fine: I am able to get the live view.

I am then able to take a picture, save it to my computer but after that the live view doesn't refresh anymore and it looks like the camera is just frozen. #15
If I try to take another picture, I get:

[ error ] Error while taking a picture: [unrecognized EdsError] inside SendCommand()
[ error ] Error while taking a picture: EDS_ERR_TAKE_PICTURE_AF_NG inside SendCommand()

Any idea what would be causing this?

I am using OF 0.8.4, Xcode 6.1.1, EDSDK 2.113, Canon EOS 500D

Thanks

Issue with ofxCv::copy()

There are some reports that using ofxCv::copy() to copy an image from live view into another ofImage isn't working, and it just creates a bunch of black pixels.

projectGenerator freezing

Hi! I just downloaded the addon, and I followed the instructions to generate a new project, but the projectGenerator freezes when I try to generate a project using ofxEdsdk. The project is generated but the path "../../../addons/ofxEdsdk/src" is not added to search paths.

tons of thread errors

was just testing this today and there are a ton of "mutex locked outside the thread" errors.

i also think the thread is getting stopped incorrectly. need to double check.

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.