Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotImplementedException in fetch_buffer method #172

Closed
jvieira88 opened this issue Jun 5, 2020 · 3 comments
Closed

NotImplementedException in fetch_buffer method #172

jvieira88 opened this issue Jun 5, 2020 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@jvieira88
Copy link

jvieira88 commented Jun 5, 2020

Describe the bug
Hi, I'm getting the following exception when trying to get an image using the fetch_buffer method:

Exception has occurred: NotImplementedException GenTL exception: Requested operation not implemented. (Message from the source: GC_ERR_NOT_IMPLEMENTED) (ID: -1003)

File "C:\Users\jv\source\repos\P1108_Rosalind\Rosalind\Camera\CoreCamera.py", line 110, in __init__
    arrFrame, oTimestamp = self.getLastFrame()
  File "C:\Users\jv\source\repos\P1108_Rosalind\Rosalind\Camera\CoreCamera.py", line 275, in getLastFrame
    buffer = self.m_oImageAcq.fetch_buffer()
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\harvesters\core.py", line 2563, in fetch_buffer
    logger=self._logger
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\harvesters\core.py", line 1094, in __init__
    logger=self._logger
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\harvesters\core.py", line 1227, in _build_payload
    buffer=buffer, node_map=node_map, logger=logger
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\harvesters\core.py", line 1403, in __init__
    buffer=buffer, node_map=node_map
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\harvesters\core.py", line 1326, in _build_component
    logger=self._logger
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\harvesters\core.py", line 834, in __init__
    self._data = self._to_np_array(proxy)
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\harvesters\core.py", line 843, in _to_np_array
    nr_bytes += self._buffer.padding_y
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\genicam\gentl.py", line 4383, in _get_padding_y
    return _gentl.Buffer__get_padding_y(self)
_gentl.NotImplementedException: GenTL exception: Requested operation not implemented. (Message from the source: GC_ERR_NOT_IMPLEMENTED) (ID: -1003)

I'm not sure why this is happening, everything was working fine a couple of days ago. The camera is also working, tried using the manufacturer software successfully.

To Reproduce
This is how I call it, m_oImageAcq is an image acquirer that has been initialised:

def getLastFrame (self):
        m_arrLastFrame = np.zeros((1920, 1200))
        if not self.m_oImageAcq:
            return m_arrLastFrame
        
        if not self.m_oImageAcq.is_acquiring_images():
            return m_arrLastFrame
        
        buffer = self.m_oImageAcq.fetch_buffer()
        component = buffer.payload.components[0]
        # Reshape the NumPy array into a 2D array:
        m_arrLastFrame = component.data.reshape(component.height, component.width)
        logging.info("Image frame acquired")

        return m_arrLastFrame

Desktop:

  • OS: Windows 10
  • Python: 3.7
  • Harvester: 1.2.3
kazunarikudo added a commit that referenced this issue Jun 5, 2020
Did not think of a case where PADDING_Y was not implemented.
@kazunarikudo
Copy link
Member

@jvieira88 Hi. Thank you for the information. I have just committed the fix to branch _issue_172. Could you try that out and tell me if it fixed the issue, please? /Kazunari

@kazunarikudo kazunarikudo added the bug Something isn't working label Jun 5, 2020
@kazunarikudo kazunarikudo added this to the 1.2.4 milestone Jun 5, 2020
@jvieira88
Copy link
Author

@kazunarikudo Hi. Thanks for your quick fix. I confirm its working now 👍

kazunarikudo added a commit that referenced this issue Jun 8, 2020
@kazunarikudo
Copy link
Member

@jvieira88 Hi. Thank you for taking your time on this issue. I have just merged the change into the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants