mbalatsko / pypylon-opencv-viewer

Easy to use Jupyter notebook viewer connecting Basler Pylon images grabbing with OpenCV image processing. Allows to specify interactive Jupyter widgets to manipulate Basler camera features values, grab camera image and at once get an OpenCV window on which raw camera output is displayed or you can specify an image processing function, which takes on the input raw camera output image and display your own output.
MIT License
30 stars 10 forks source link

AcquisitionFrameRateAbs fails #2

Closed Resonanz closed 5 years ago

Resonanz commented 5 years ago

The features dict works if I replace GainRaw with Gain (as noted elsewhere), however we are crashing out at 1AcquisitionFrameRateAbs

---------------------------------------------------------------------------
LogicalErrorException                     Traceback (most recent call last)
<ipython-input-63-858e4d7922fd> in <module>
      1 from pypylon_opencv_viewer import BaslerOpenCVViewer
      2 viewer = BaslerOpenCVViewer(camera)
----> 3 viewer.set_features(features)
      4 viewer.set_impro_function(impro)
      5 viewer.run_interaction_continuous_shot(image_folder='~/Documents/images')

C:\ProgramData\Anaconda3\lib\site-packages\pypylon_opencv_viewer\viewer.py in set_features(self, features)
    105             if feature_name is None:
    106                 raise ValueError("'name' attribute can't be None")
--> 107             pylon_feature = getattr(self._camera, feature_name)
    108 
    109             widget_kwargs['description'] = re.sub('([a-z])([A-Z])', r'\1 \2', feature_name) + " :"

C:\ProgramData\Anaconda3\lib\site-packages\pypylon\pylon.py in __getattr__(self, attribute)
   4037             return object.__getattr__(self, attribute)
   4038         else:
-> 4039             return self.GetNodeMap().GetNode(attribute)
   4040 
   4041     def __setattr__(self, attribute, val):

C:\ProgramData\Anaconda3\lib\site-packages\pypylon\genicam.py in GetNode(self, Name)
   1471 
   1472     def GetNode(self, Name: 'GENICAM_NAMESPACE::gcstring const &') -> "GENAPI_NAMESPACE::INode *":
-> 1473         return _genicam.INodeMap_GetNode(self, Name)
   1474 
   1475     def InvalidateNodes(self) -> "void":

LogicalErrorException: Node not existing (file 'genicam_wrap.cpp', line 16599)
Resonanz commented 5 years ago

Hard to believe I have spent a couple of hours trying to make this work only to find that "AcquisitionFrameRateAbs" needed changing to "AcquisitionFrameRate". There is zero documentation for this AFAICT, and it was a guess following Basler's similar dropping of "Raw" from "GainRaw". Sigh.

Kasape commented 5 years ago

From the new version you will get a much nicer exception when you use the wrong name of a feature. Closing this