| 246 | # reads an image from the url |
| 247 | # url : the location to the image (string, like 'http://www.*.jpg' or 'file:///home/*/.jpg' |
| 248 | def readImage(self, url): |
| 249 | if url.count('file:///'): |
| 250 | # get the image from the local directory |
| 251 | img = cv2.imread(url[url.find('file:///') + 7:]) |
| 252 | else: |
| 253 | # get the image from the internet |
| 254 | response = requests.get(url) |
| 255 | data = numpy.fromstring(response.content, numpy.uint8) |
| 256 | img = cv2.imdecode(data, 1) |
| 257 | |
| 258 | return img |
| 259 | |
| 260 | def improve(self, rgb_image): |
| 261 | if numpy.amax(rgb_image) > 1: |