<commit_before>## Read Image with Bayer Mosaic

Reads image into numpy ndarray and splits the path and image filename. This is a wrapper for the OpenCV function [imread](http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html). In contrast to `readimage`, this function is specifically designed to read images with Bayer mosaic pixel pattern and return a demosaicked image.

**plantcv.readbayer**(*filename, bayerpattern = 'BG', alg = "default"*)

**returns** img, path, image filename

- **Parameters:**
    - filename - image file to be read (possibly including a path)
    - bayerpattern  - arrangement of the pixels. Often found by trial and error. ("BG","GB","RG","GR")
    - alg - algorithm with which to demosaic the image. ("default","EdgeAware","VariableNumberGradients")

- **Context:**
    - Reads in an image file with Bayer mosaic pixel pattern to be processed
- **Example use:**
    - Not available, but could substitute for `readimage` [in VIS Tutorial](vis_tutorial.md)

```python
from plantcv import plantcv as pcv      

# Set global debug behavior to None (default), "print" (to file), or "plot" (Jupyter Notebooks or X11)
pcv.params.debug = "print"

#read in image
img, path, img_filename=pcv.readbayer("home/user/images/test-image.tiff")
```<commit_msg>update doc file<commit_after>## Read Image with Bayer Mosaic

Reads image into numpy ndarray and splits the path and image filename. This is a wrapper for the OpenCV function [imread](http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html). In contrast to `readimage`, this function is specifically designed to read images with Bayer mosaic pixel pattern and return a demosaicked image.

**plantcv.readbayer**(*filename, bayerpattern = 'BG', alg = "default"*)

**returns** img, path, image filename

- **Parameters:**
    - filename - image file to be read (possibly including a path)
    - bayerpattern  - arrangement of the pixels. Often found by trial and error. ("BG","GB","RG","GR")
    - alg - algorithm with which to demosaic the image. ("default","EdgeAware","VariableNumberGradients")

- **Context:**
    - Reads in an image file with Bayer mosaic pixel pattern to be processed
- **Example use:**
    - Not exactly available, but could substitute for `readimage` [in VIS Tutorial](vis_tutorial.md)

```python
from plantcv import plantcv as pcv      

# Set global debug behavior to None (default), "print" (to file), or "plot" (Jupyter Notebooks or X11)
pcv.params.debug = "print"

#read in image
img, path, img_filename=pcv.readbayer("home/user/images/test-image.tiff")
```
{'fraction_non_alphanumeric': 0.11314984709480122, 'fraction_numerical': 0.0015290519877675841, 'mean_word_length': 4.544491525423729, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4779390', 'n_tokens_mistral': 782, 'n_tokens_neox': 753, 'n_words': 299}