# Watermark appearing when method is called more than once

**URL:** <https://forum.commonvisionblox.com/t/watermark-appearing-when-method-is-called-more-than-once/1841>\
**Category:** Python API\
**Created:** [November 29, 2022, 9:46am UTC](https://forum.commonvisionblox.com/t/watermark-appearing-when-method-is-called-more-than-once/1841 "2022-11-29T09:46:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arnaud](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@Arnaud](https://forum.commonvisionblox.com/u/Arnaud)\
**Post date:** [November 29, 2022, 9:46am UTC](https://forum.commonvisionblox.com/t/watermark-appearing-when-method-is-called-more-than-once/1841/1 "2022-11-29T09:46:11Z")

</div>

Hi all,

I am working on a moving camera setup, every time the camera arrives at a specified location in the plane I call a function save\_images(). There are 3 images to be saved per position, 1 bayered image I want to debayer, and two images in the Near Infra Red. When running my save\_images() method for the first time ( = at the first position ) , no problem occurs. When the camera moves on to the next positions and the save\_images() get’s called for the second time, a watermark appears on the debayerd image. How can I solve this problem?

Thanks in advance

 ![cvb](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/2X/2/2bcc3eddea3256e2f55822c75fc58b8e41f97f7b.png)

The code of the save\_images() method :

````auto
save_images(self, folder_name : str , ipos : int):
        """This method saves the images as a numpy array to a certain folder_name,
            ipos is an integer which tells us to which measurement the image belongs"""
            
        devices = cvb.DeviceFactory.discover_from_root(cvb.DiscoverFlags.IgnoreVins)
        with cvb.DeviceFactory.open(devices[0].access_token, cvb.AcquisitionStack.GenTL) as device:
            streams = [device.stream(cvb.ImageStream, i) for i in range(device.stream_count)]
            for stream in streams:
                stream.engine_start()
            for stream in streams:
                stream.device_start()
            for i in range(1):
                images = [stream.wait() for stream in streams]
            try:
                pass
            finally:
                image_no = 1 
                for image, status, nodes in images:
                    if image_no == 1 :
                        image = cvb.foundation.bayer_to_rgb(image,1,1)
                    filename = os.path.join(folder_name + '\\' + str(ipos) + '_' + str(image_no) + '.jpg')
                    print(filename)
                    nparrayim = cvb.as_array(image)
                    plt.imsave(filename, nparrayim)
                    image_no += 1
                with image:
                    print("Acquired image: " + str(i) + " | Timestamp: " + str(image.raw_timestamp))
            for stream in streams:
                stream.device_abort()
            for stream in streams:
                stream.engine_abort()```
````

---

<div class="post-metadata">

**Author:** ![s-woe](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/s-woe/32/572_2.png) [@s-woe](https://forum.commonvisionblox.com/u/s-woe)\
**Post date:** [November 29, 2022, 9:56am UTC](https://forum.commonvisionblox.com/t/watermark-appearing-when-method-is-called-more-than-once/1841/2 "2022-11-29T09:56:27Z")

</div>

Do you have a valid foundation license? Maybe look into your LicenseManager.
