color_bbox Subroutine

public subroutine color_bbox(img, w, h, rgb, tol, x0, x1, y0, y1, count, region)

Bounding box (0-based columns x0..x1, rows y0..y1) and pixel count of pixels within tol of rgb in every channel. count = 0 when none. region = [col_lo, col_hi, row_lo, row_hi] limits the search.

Arguments

Type IntentOptional Attributes Name
integer(kind=1), intent(in) :: img(:)
integer, intent(in) :: w
integer, intent(in) :: h
integer, intent(in) :: rgb(3)
integer, intent(in) :: tol
integer, intent(out) :: x0
integer, intent(out) :: x1
integer, intent(out) :: y0
integer, intent(out) :: y1
integer, intent(out) :: count
integer, intent(in), optional :: region(4)