# How to integrate a camera into ImSwitch?

**URL:** <https://openuc2.discourse.group/t/how-to-integrate-a-camera-into-imswitch/50>\
**Category:** openUC2 ImSwitch\
**Created:** [June 26, 2024, 1:36pm UTC](https://openuc2.discourse.group/t/how-to-integrate-a-camera-into-imswitch/50 "2024-06-26T13:36:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HaiyueLi](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@HaiyueLi](https://openuc2.discourse.group/u/HaiyueLi)\
**Post date:** [June 26, 2024, 1:36pm UTC](https://openuc2.discourse.group/t/how-to-integrate-a-camera-into-imswitch/50/1 "2024-06-26T13:36:01Z")

</div>

I have a Vimba camera(1800 U-501m), and I want to know how to integrate it into ImSwitch and use ImSwitch to control it for image acquisition.

---

<div class="post-metadata">

**Author:** ![benedictdied](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@benedictdied](https://openuc2.discourse.group/u/benedictdied)\
**Post date:** [June 27, 2024, 11:14am UTC](https://openuc2.discourse.group/t/how-to-integrate-a-camera-into-imswitch/50/2 "2024-06-27T11:14:00Z")

</div>

Thanks @HaiyueLi for reaching out to us. In fact you would need to modify the configuration file which is documented in this repository:

> **[GitHub - openUC2/ImSwitchConfig](https://github.com/openUC2/imswitchconfig)**
>
> Contribute to openUC2/ImSwitchConfig development by creating an account on GitHub.

In fact, you would need to either create or modify a `setup.json` file that is in the folder `~/ImSwitchConfig/imcontrol` to have the Vimba detector as a detector. One way of doing that would be the following:

```auto
    "detectors": {
        "WidefieldCamera": {
            "analogChannel": null,
            "digitalLine": null,
            "managerName": "AVManager",
            "managerProperties": {
                "cameraListIndex": 1,
                "avcam": {
                    "exposure": 0,
                    "gain": 0,
                    "blacklevel": 100,
                    "image_width": 1000,
                    "image_height": 1000,
                    "pixel_format": "Mono12"
                }
            },
            "forAcquisition": true,
            "forFocusLock": false
        }
    },

```

Please add this to your `setup.json` file (you can call it however you like…). To use this setup configuration file in your system, you need to specify that in your `imcontrol_options.json` under `~/ImSwitchConfig/config`. Change the `"setupFileName": "XXXsetup.json"` (which is pointing to the file under `imcontrol_setup`. On you next start this file will be used for the setup configuration (you can also specify other things like stage, etc.).

you can read more about this here: [Hardware control configurations — ImSwitch documentation](https://imswitch.readthedocs.io/en/stable/imcontrol-setups.html?highlight=setup)

To test if the camera actually works, please revise the following tests:

> <https://github.com/morefigs/pymba/blob/master/examples/camera/opencv_acquire_image.py>

Let me know if this helps.

**Important** Vimba X won’t work. You have to use Vimba Viewer 6 or something like that.
