added code to extract areas of interest from frames