# combining binary images with masks

**URL:** <https://forums.openmv.io/t/combining-binary-images-with-masks/984>\
**Category:** OpenMV Boards\
**Created:** [November 3, 2018, 12:39am UTC](https://forums.openmv.io/t/combining-binary-images-with-masks/984 "2018-11-03T00:39:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmmarouen](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mmmarouen](https://forums.openmv.io/u/mmmarouen)\
**Post date:** [November 3, 2018, 12:39am UTC](https://forums.openmv.io/t/combining-binary-images-with-masks/984/1 "2018-11-03T00:39:57Z")

</div>

Hello,

When applying img\*\*.binary\*\* I receive the error message: “TypeError: function missing 1 required positional arguments”  
This probably due to either incorrect usage of the binary function or the masks or both 😃  
Any ideas please?

```python
imbin = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565)
imbin.replace(sensor.snapshot())
while(pyb.elapsed_millis(start) < record_time):
    img = sensor.snapshot().histeq() 
    imbin.clear() #reset the mask
    blobs = img.find_blobs([thresholds[threshold_index]], roi=roi, merge=False) 
    if blobs:
        most_pixels = 0
        largest_blob = 0
        for i in range(len(blobs)):
            if blobs[i].pixels() > most_pixels:
                most_pixels = blobs[i].pixels()
                largest_blob = i
        imbin.draw_rectangle(blobs[largest_blob].rect(),color=(255,255,255),fill=True).to_bitmap() #update mask with the found blob
        img.binary(thresholds=[thresholds[threshold_index]],mask=imbin) #here's where I get the error code

```

Thanks for support,  
Marouen

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [November 3, 2018, 5:45pm UTC](https://forums.openmv.io/t/combining-binary-images-with-masks/984/2 "2018-11-03T17:45:41Z")

</div>

Thresholds is not a keyword argument. Remove the keyword “thresholds=”.
