jordens / pyflycapture2

python bindings for the flycapture v2 api (libflycapture-2c)
37 stars 31 forks source link

Missing several functions #25

Closed cvanclee closed 7 years ago

cvanclee commented 7 years ago

I installed pyflycapture but am missing several methods that I expected to be there. The install folder created is attached, along with an example of my problem. The methods I have noticed I am missing are: write_register read_register get_configuration set_configuration

I may be missing others, but those are the ones I noticed.

EXAMPLE ERROR:

AttributeError: type object 'flycapture2.Context' has no attribute 'get_configuration'

EXAMPLE CODE:

import flycapture2 as pyc2
import sys

class CameraProperties:
    def __init__(self):
        self.camSet = pyc2.Context()
        try:
            self.camSet.connect(*self.camSet.get_camera_from_index(0))
        except:
            print ("Fatal: failed to connect to camera:", sys.exc_info())
            sys.exit()

        fmt7info, supported = self.camSet.get_format7_info(1)
        self.camSet.set_format7_configuration(1, 0, 0, fmt7info['max_width'],
                                              fmt7info['max_height'], pyc2.PIXEL_FORMAT_MONO16)

        p = self.camSet.getConfiguration() #ERROR HERE
        p['grab_mode'] = pyc2.GRAB_MODE.DROP_FRAMES
        self.camSet.set_configuration() #I know this is missing parameters, code doesn't reach here anyways

if __name__ == '__main__':
    camProp = CameraProperties()

My install folder: pyflycapture2.tar.gz

Camera: GS3-U3-28S4M FlyCap version: FlyCap SDK 2.9.3.43 OS: Ubuntu 14.04.5

jordens commented 7 years ago

self.camSet.get_configuration()

cvanclee commented 7 years ago

ahhh no that's what it said! I changed to Context.get_configuration() while I was trying to fix the problem. I edited the code

On Fri, Jun 9, 2017 at 3:54 PM, Robert Jördens notifications@github.com wrote:

Closed #25 https://github.com/jordens/pyflycapture2/issues/25.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jordens/pyflycapture2/issues/25#event-1117837683, or mute the thread https://github.com/notifications/unsubscribe-auth/AVD7tYYoGm-qQXq3MgPsHIr0JK4m19A4ks5sCaL1gaJpZM4N1wUh .

jordens commented 7 years ago
cvanclee commented 7 years ago
import flycapture2 as pyc2 
import sys

class CameraProperties:
    def __init__(self):
        #Connect camera
        self.camSet = pyc2.Context()
        try:
            self.camSet.connect(*self.camSet.get_camera_from_index(0))
        except:
            print ("Fatal: failed to connect to camera:", sys.exc_info()) 
            sys.exit()

        fmt7info, supported = self.camSet.get_format7_info(1)
        self.camSet.set_format7_configuration(1, 0, 0, fmt7info['max_width'], 
                                          fmt7info['max_height'], 
                                          pyc2.PIXEL_FORMAT_MONO16)

        #Remove buffer (gurantee most recent image is grabbed?)
        p = self.camSet.get_configuration()
        p['grab_mode'] = pyc2.GRAB_MODE.DROP_FRAMES
        self.camSet.set_configuration()

if __name__ == '__main__':
    print(pyc2.__file__)
    camProp = CameraProperties()

/home/cvancleef/.cache/Python-Eggs/pyflycapture2-0.1+dev-py2.7-linux-x86_64.egg-tmp/flycapture2.so Traceback (most recent call last): File "/home/cvancleef/untitled0.py", line 27, in camProp = CameraProperties() File "/home/cvancleef/untitled0.py", line 21, in init p = self.camSet.get_configuration() AttributeError: 'flycapture2.Context' object has no attribute 'get_configuration'

jordens commented 7 years ago

And does /home/cvancleef/.cache/Python-Eggs/pyflycapture2-0.1+dev-py2.7-linux-x86_64.egg-tmp/flycapture2.so refer to the pyflycapture2 version and installation you expect? I have seen this a couple times already that people have installed multiple versions of pyflycapture2 and then they get caught out by an old one they have around. get_configuration() was only added last September.

cvanclee commented 7 years ago

This is my first time using pyflycapture, so there shouldn't be older installations, and 0.1+dev is the most recent version, correct? The folder was made June 9 2017. So yes, this is what I expected.

On Mon, Jun 12, 2017 at 12:04 PM, Robert Jördens notifications@github.com wrote:

And does /home/cvancleef/.cache/Python-Eggs/pyflycapture2-0.1+dev- py2.7-linux-x86_64.egg-tmp/flycapture2.so refer to the pyflycapture2 version and installation you expect? I have seen this a couple times already that people have installed multiple versions of pyflycapture2 and then they get caught out by an old one they have around. get_configuration() was only added last September.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jordens/pyflycapture2/issues/25#issuecomment-307836019, or mute the thread https://github.com/notifications/unsubscribe-auth/AVD7tRcXqJUfGXZ9FKN6TzBtvhU8ETlNks5sDWGogaJpZM4N1wUh .

jordens commented 7 years ago

0.1+dev has been the development version for a couple of years now. From that alone I can't tell whether it is new enough.

cvanclee commented 7 years ago

How could I tell whether its the right version? I installed from the command

git clone https://github.com/peterpolidoro/pyflycapture2.git

On Mon, Jun 12, 2017 at 12:24 PM, Robert Jördens notifications@github.com wrote:

0.1+dev has been the development version for a couple of years now. From that alone I can't tell whether it is new enough.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jordens/pyflycapture2/issues/25#issuecomment-307841528, or mute the thread https://github.com/notifications/unsubscribe-auth/AVD7tQH2m5EmoOWwAgoaZC_SUbIWvouwks5sDWYrgaJpZM4N1wUh .

jordens commented 7 years ago

Well that solves it.

git clone https://github.com/jordens/pyflycapture2.git

cvanclee commented 7 years ago

Ah, I see. It may be a good idea to change the installation instructions? Thank you

On Mon, Jun 12, 2017 at 2:40 PM, Robert Jördens notifications@github.com wrote:

Well that solves it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jordens/pyflycapture2/issues/25#issuecomment-307880887, or mute the thread https://github.com/notifications/unsubscribe-auth/AVD7tUNE8UH2KzNiC3fB1OiigLeZ-pcdks5sDYYIgaJpZM4N1wUh .

villanuevab commented 7 years ago

If I tried installing via python setup.py install with the source code in this repo, how should we uninstall this installation or check for multiple installations (I also tried installing via pip install pyflycapture2)? Unfortunately I did not use a virtualenv this time :(

jordens commented 7 years ago

pip uninstall