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

HikRobot cti file (MVS) #442

Open
2 of 5 tasks
abogadi opened this issue Feb 7, 2024 · 3 comments
Open
2 of 5 tasks

HikRobot cti file (MVS) #442

abogadi opened this issue Feb 7, 2024 · 3 comments

Comments

@abogadi
Copy link

abogadi commented Feb 7, 2024

Describe the Issue
Harvesters raises LogicalErrorException when trying to use HikRobot cti file.
I would like to understand if this is a Hikrobot driver issue or something that can be resolved in Harvesters.
I am keen to help resolve this issue, if further or specific tests are needed please let me know!

To Reproduce
Steps to reproduce the behavior:
Se sample code below

Sample Code
I can show a piece of code that demonstrates the reported phenomenon:

  • Yes
  • No
  • [] (Please select either yes or no.)

If yes, please provide a sample code:

from harvesters.core import Harvester
import sys
import traceback
import cv2
import time

def main():
    h = Harvester()
    h.add_file("C:\\Program Files (x86)\\Common Files\\MVS\\Runtime\\Win64_x64\\MvProducerGEV.cti") 
    h.update()
    time.sleep(1)
    print(len(h.device_info_list))
    for onedevice in h.device_info_list:
        print(onedevice)
        print('next')
    ia = h.create(0)
    #ia.device.node_map.PixelFormat.value = 'BayerRG8'
    #ia.device.node_map.TestPattern = 'HorizontalColorBar'
    try:
        ia.start()
        i = 0
        done = False
        while not done:
            with ia.fetch() as buffer:
                img = buffer.payload.components[0].data
                img = img.reshape(buffer.payload.components[0].height, buffer.payload.components[0].width,3)
                img_copy = img.copy()
                img_copy = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
                cv2.namedWindow("window", cv2.WINDOW_KEEPRATIO | cv2.WINDOW_NORMAL)
                cv2.imshow("window", img_copy)
                fps = ia.statistics.fps
                print("FPS: ", fps)
                if cv2.waitKey(10) == ord('q'):
                    done = True
                    print('break')
                i = i + 1
    except Exception as e:
        traceback.print_exc(file=sys.stdout)
    finally:
        ia.stop()
        ia.destroy()
        cv2.destroyAllWindows()
        print('finally')
        h.reset()

if __name__ == "__main__":
    main()

If applicable, please paste the actual output (its whole traceback, etc) here:

E:\vis\newvenv310\Scripts\python.exe E:\vis\harvester.py 
Traceback (most recent call last):
  File "E:\vis\harvester.py", line 62, in <module>
    main()
  File "E:\vis\harvester.py", line 24, in main
    h.update()
  File "E:\vis\newvenv310\lib\site-packages\harvesters\core.py", line 3446, in update
    self._open_systems()
  File "E:\vis\newvenv310\lib\site-packages\harvesters\core.py", line 3341, in _open_systems
    self._systems.append(System(module=raw_system, parent=producer))
  File "E:\vis\newvenv310\lib\site-packages\harvesters\core.py", line 515, in __init__
    super().__init__(module=module, parent=parent, port=module.port)
  File "E:\vis\newvenv310\lib\site-packages\harvesters\core.py", line 281, in __init__
    self._node_map = self._create_node_map(
  File "E:\vis\newvenv310\lib\site-packages\harvesters\core.py", line 320, in _create_node_map
    clean_up_required, file_path = self._retrieve_file_path(
  File "E:\vis\newvenv310\lib\site-packages\harvesters\core.py", line 378, in _retrieve_file_path
    raise LogicalErrorException(
_genapi.LogicalErrorException: The target port does not hold any URL.

Process finished with exit code 1

Expected Behavior
Open camera and acquire images

Screenshots

Configuration

  • OS: Windows x64
  • Python: 3.10
  • Harvester: 1.4.2
  • GenTL Producer: MVS 64bit V4.3.0 build 20231124 (C:\Program Files (x86)\Common Files\MVS\Runtime\Win64_x64\MvProducerGEV.cti)
  • Camera: HikRobot MV-CA050-12GC

Reproducibility

This phenomenon can be stably reproduced:

  • Yes
  • No.
  • [] (Please select either yes or no.)

If applicable, please provide your observation about the reproducibility.

Actions You Have Taken

Additional context
Add any other context about the problem here.

@ardainanc
Copy link

Hi. I am having the same issue with MVS and harvesters on Ubuntu x64. Were you able to find a solution? I tried to update MVS and sdk form hikvision website but unfortunately it didnt work.

@abogadi
Copy link
Author

abogadi commented Feb 14, 2024

No, I am still waiting to hear back from Hikrobot on the same topic

@ardainanc
Copy link

Hi again. I found a temporary solution for our case. I used mvGenTL_Acquire as it doesn't block the other producers products. You can find the relevent info here: https://harvesters.readthedocs.io/en/latest/INSTALL.html#installing-a-gentl-producer . This worked with my mv-cs060 gige camera. It would also be great if you can notify me when you here back from Hikrobot on their own .cti file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants