Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Aborted (core dumped)

$
0
0
Run on Python 2.7 and OpenCV with Ubuntu12.04. Error; terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr: __pos (which is 140) > this->size() (which is 7) Aborted (core dumped) Thnx import urllib import cv2 import numpy as np import os def store_raw_images(): neg_image_link = 'http://image-net.org/api/text/imagenet.synset.geturls?wnid=n02708433' neg_image_urls = urllib.urlopen(neg_image_link).read().decode() if not os.path.exists('neg'): os.makedirs('neg') pic_num = 1 for i in neg_image_urls.split('\n'): try: print(i) urllib.urlretrieve(i,"neg/"+str(pic_num)+'.jpg') img = cv2.imread("neg/"+str(pic_num)+'.jpg', cv2.IMREAD_GRAYSCALE) resized_image = cv2.resize(img) cv2.imwrite("neg/"+str(pic_num)+'.jpg',resized_image) pic_num += 1 except Exception as e: print(str(e)) store_raw_images()

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>