# Incorrect Colors with Dalsa Genie nano C4900

**URL:** <https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345>\
**Category:** Python API\
**Created:** [February 16, 2021, 1:05pm UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345 "2021-02-16T13:05:03Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ofilipejorge](https://avatars.discourse-cdn.com/v4/letter/o/5daacb/32.png) [@ofilipejorge](https://forum.commonvisionblox.com/u/ofilipejorge)\
**Post date:** [February 16, 2021, 1:05pm UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/1 "2021-02-16T13:05:03Z")

</div>

Hello!  
I have been trying to get images from the Genie nano C4900 using python with cvb, but they show up with muted colors when compared to the capture taken from Sapera own viewer:

 ![test](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/1X/fb6aa1a02bbd2df21f8375ac8ffb97e9471384be.jpeg)

At first i thought it was a situation of changing R and B channels but it does not seem like it, as the blue from the corner of the painting is right on. Still, the issue seems to be specifically on the red channel, as the chair should be red.  
I did try to configure the node maps to have the same exposure, balance ratio and image format to no improvement from that of the Sapera configuration. The same problem happens with the cvb viewer program.

EDIT: Forgot to include the code sample used for image aquisition with cvb:

```python
    import cvb
    if __name__ == " __main__":
        path = cvb.install_path() + "/Drivers/GenICam.vin"
        with cvb.DeviceFactory.open(path) as device:
              stream = device.stream
              stream.start()
              image, status = stream.wait_for(1000)
              if status != cvb.WaitStatus.Ok:
                    raise RuntimeError("timeout during wait" 
                    if status == cvb.WaitStatus.Timeout else 
                    "acquisition aborted")
              image.save("img.bmp")
              stream.abort()

```

Python environment is with Anaconda on Windows

---

<div class="post-metadata">

**Author:** ![MandanaS](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/mandanas/32/1211_2.png) [@MandanaS](https://forum.commonvisionblox.com/u/MandanaS)\
**Post date:** [February 19, 2021, 7:04am UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/2 "2021-02-19T07:04:33Z")

</div>

Hi,

Would you please let us know the color format that you choose in CVB and Sapera? To get the setting in CVB, you can simply send us the driver Configuration file “GeniCam.ini” which can be found under “%cvbdata%Drivers”.With Sapera viewer, du you mean the CamExpert? there you can save the camera setting which is shown in screenshot. Please send us both files from CVB and Sapera.

Are both images saved in bmp format?  
Furthermore, Do you use the preprocessing in Camexper?

 ![PreprocessingInCamExpert](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/1X/ae5efe004caf2efee0c85783ba6c11060f2d67dc.png) ![CameraSettingsinCamExpert](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/1X/3c48a7af92bac00de698b66d6af2578f8dc85879.png)

---

<div class="post-metadata">

**Author:** ![ofilipejorge](https://avatars.discourse-cdn.com/v4/letter/o/5daacb/32.png) [@ofilipejorge](https://forum.commonvisionblox.com/u/ofilipejorge)\
**Post date:** [February 19, 2021, 11:28am UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/3 "2021-02-19T11:28:48Z")

</div>

> [@MandanaS](#):
>
> With Sapera viewer, du you mean the CamExpert?

Yes!

> [@MandanaS](#):
>
> Are both images saved in bmp format?

Both images were saved in bmp, i just had to convert externally to jpeg so i could upload it here. Images were obtained in 8 bit RGB format.

> [@MandanaS](#):
>
> Furthermore, Do you use the preprocessing in Camexper?

I do not use any of those, and they are all greyed out to me:

 ![pre-processing](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/1X/5ad6c98ae091fa6c47ac0c696bffddfb0c0b0085.jpeg)

The cfg from cvb and camera settings from sapera are in the zip file  
[cfg\_files.zip](https://forum.commonvisionblox.com/uploads/short-url/auPYvxfA8t6AnXExPTqjtUuZgrp.zip) (2.5 KB)

---

<div class="post-metadata">

**Author:** ![MandanaS](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/mandanas/32/1211_2.png) [@MandanaS](https://forum.commonvisionblox.com/u/MandanaS)\
**Post date:** [February 19, 2021, 1:03pm UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/4 "2021-02-19T13:03:52Z")

</div>

Thanks for the files even though we need one more information!  
Please open the “Common Vision Blox Viewer” which is already installed by CVB installation and load the “GenICam.vin” file via file\>open. Then open the device Nodemap demonstrated in the attached screenshot and send us the pixelformat mentioned there.

We will try to reproduce the problem on our side, as soon as we have the information!

 ![CommonVisionBloxViewer](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/1X/a3c63d15a508f7f778847b1be429175c23238a97.png)

---

<div class="post-metadata">

**Author:** ![ofilipejorge](https://avatars.discourse-cdn.com/v4/letter/o/5daacb/32.png) [@ofilipejorge](https://forum.commonvisionblox.com/u/ofilipejorge)\
**Post date:** [February 19, 2021, 2:55pm UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/5 "2021-02-19T14:55:01Z")

</div>

The viewer says it cannot load the vin file even with admin rights:  
 ![imagem_2021-02-19_145208](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/1X/a8ab9accd147ef77b933980a2509781eb41afe93.png)

---

<div class="post-metadata">

**Author:** ![ofilipejorge](https://avatars.discourse-cdn.com/v4/letter/o/5daacb/32.png) [@ofilipejorge](https://forum.commonvisionblox.com/u/ofilipejorge)\
**Post date:** [February 22, 2021, 11:36am UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/6 "2021-02-22T11:36:40Z")

</div>

If it helps i’m sending my “GenICam.vin” [GenICam.zip](https://forum.commonvisionblox.com/uploads/short-url/jRUEva5u3VJve5K5FScw1uZFt2W.zip) (1.7 MB)

---

<div class="post-metadata">

**Author:** ![MandanaS](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/mandanas/32/1211_2.png) [@MandanaS](https://forum.commonvisionblox.com/u/MandanaS)\
**Post date:** [February 23, 2021, 7:15am UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/7 "2021-02-23T07:15:08Z")

</div>

Please be sure that the “GenICam.vin” file is not used in another Application simultaneously. When you can load this file in your application there should be no problem to load it in the CVBViewer.

---

<div class="post-metadata">

**Author:** ![MandanaS](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/mandanas/32/1211_2.png) [@MandanaS](https://forum.commonvisionblox.com/u/MandanaS)\
**Post date:** [February 23, 2021, 7:15am UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/8 "2021-02-23T07:15:56Z")

</div>

This file does not help, it does not contain the nodemap.

---

<div class="post-metadata">

**Author:** ![ofilipejorge](https://avatars.discourse-cdn.com/v4/letter/o/5daacb/32.png) [@ofilipejorge](https://forum.commonvisionblox.com/u/ofilipejorge)\
**Post date:** [February 23, 2021, 12:11pm UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/9 "2021-02-23T12:11:49Z")

</div>

I apologize, i noticed i forgot to save the configured device into it.  
The Image Format is as follows:

 ![imagem_2021-02-23_121057](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/1X/5977f19c3da570aec34453c7ed2f4211d5a4c681.png)

---

<div class="post-metadata">

**Author:** ![MandanaS](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/mandanas/32/1211_2.png) [@MandanaS](https://forum.commonvisionblox.com/u/MandanaS)\
**Post date:** [February 25, 2021, 8:31am UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/10 "2021-02-25T08:31:12Z")

</div>

Thanks for the information. I ask our software development team whether this color format is correctly supported or not. We do not have the same camera in our warehause but I search for another Geni Nano with the same color format and try to reproduce the behavior.

Meanwhile you can change color format in CVB to BayerGB8 or BayerBG8, that would probably solve the Problem.

---

<div class="post-metadata">

**Author:** ![ofilipejorge](https://avatars.discourse-cdn.com/v4/letter/o/5daacb/32.png) [@ofilipejorge](https://forum.commonvisionblox.com/u/ofilipejorge)\
**Post date:** [March 1, 2021, 12:21pm UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/11 "2021-03-01T12:21:45Z")

</div>

Thank you! Switching the pixel format to RAW ended up fixing it. Apparently this specific camera is able to output RGB or Bayer from its datasheet. I changed it in the .ini files to 0 for this.  
Is there a proper way to do this from the python library?

---

<div class="post-metadata">

**Author:** ![MandanaS](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/mandanas/32/1211_2.png) [@MandanaS](https://forum.commonvisionblox.com/u/MandanaS)\
**Post date:** [March 2, 2021, 9:38am UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/12 "2021-03-02T09:38:22Z")

</div>

That is nice to hear that it works now as it is expected. Yes, there is a way to set the pixel format in the code but then you cannot use the GenICam.vin driver and you should discover the connected camera in the code as well (discover\_from\_()) : [Cvbpy: DeviceFactory Class Reference (commonvisionblox.com)](https://help.commonvisionblox.com/NextGen/14.0/cvbpy/d9/dde/classcvb_1_1_device_factory.html)

and use the function " set\_parameter()" to set the pixel format in CVB Gen TL : [Cvbpy: DiscoveryInformation Class Reference (commonvisionblox.com)](https://help.commonvisionblox.com/NextGen/14.0/cvbpy/d5/d30/classcvb_1_1_discovery_information.html)

---

<div class="post-metadata">

**Author:** ![ofilipejorge](https://avatars.discourse-cdn.com/v4/letter/o/5daacb/32.png) [@ofilipejorge](https://forum.commonvisionblox.com/u/ofilipejorge)\
**Post date:** [March 2, 2021, 8:44pm UTC](https://forum.commonvisionblox.com/t/incorrect-colors-with-dalsa-genie-nano-c4900/1345/13 "2021-03-02T20:44:30Z")

</div>

Okay, thank you! I marked your previous reply as answer if someone ends up with the same situation as mine.
