Questions tagged [scikit-image]

scikit-image is a Python image processing toolbox for SciPy.

scikit-image is a collection of algorithms for image processing with SciPy. The scikit-image SciKit extends scipy.ndimage to provide a versatile set of image processing routines.

1871 questions
86
votes
11 answers

Import error No module named skimage

I am building code on python using skimage. But I am getting import errors while using skimage.segmentation. Traceback (most recent call last): File "superpixel.py", line 5, in from skimage.segmentation import slic ImportError: No module named…
user583088
  • 989
  • 1
  • 6
  • 10
75
votes
7 answers

ImportError: cannot import name '_validate_lengths'

I have started learning Tensorflow. I am using Pycharm and my environment is Ubuntu 16.04. I am following the tutorial. I cross check the nump. It is up-to-date. I don't know the reason of this error. from numpy.lib.arraypad import…
John
  • 835
  • 1
  • 6
  • 14
64
votes
6 answers

How do I remove the background from this kind of image?

I want to remove the background of this image to get the person only. I have thousand of images like this, basically, a person and a somewhat whitish background. What I have done is to use edge detector like canny edge detector or sobel filter…
hans-t
  • 3,093
  • 8
  • 33
  • 39
63
votes
4 answers

inline images have low quality

I'm loading a TIF file with scikit-image and displaying it inline in an ipython notebook (version 2.2.0). This works, however, the image is quite small when first displayed, and when I resize it using the draggable handle on the bottom right of the…
jimbotron
  • 655
  • 1
  • 5
  • 8
60
votes
9 answers

Calculating percentage of Bounding box overlap, for image detector evaluation

In testing an object detection algorithm in large images, we check our detected bounding boxes against the coordinates given for the ground truth rectangles. According to the Pascal VOC challenges, there's this: A predicted bounding box is…
user961627
  • 12,379
  • 42
  • 136
  • 210
58
votes
4 answers

How to find the average colour of an image in Python with OpenCV?

I tried this code: import cv2 image = cv2.imread("sample.jpg") pixel = image[200, 550] print pixel But I am getting error as: 'Nonetype' no attributes error getitem This error is getting displayed after executing the third line of code.
56
votes
7 answers

How can I read an image from an Internet URL in Python cv2, scikit image and mahotas?

How can I read an image from an Internet URL in Python cv2? This Stack Overflow answer, import cv2.cv as cv import urllib2 from cStringIO import StringIO import PIL.Image as pil url="some_url" img_file = urllib2.urlopen(url) im =…
postgres
  • 2,242
  • 5
  • 34
  • 50
44
votes
2 answers

Split text lines in scanned document

I am trying to find a way to break the split the lines of text in a scanned document that has been adaptive thresholded. Right now, I am storing the pixel values of the document as unsigned ints from 0 to 255, and I am taking the average of the…
Alex
  • 3,946
  • 11
  • 38
  • 66
39
votes
4 answers

ImportError: cannot import name 'structural_similarity' error

In my image comparision code following: https://www.pyimagesearch.com/2014/09/15/python-compare-two-images/ While using from skimage.measure import structural_similarity as ssim and then s = ssim(imageA, imageB) I am getting error: from…
Om Sao
  • 7,064
  • 2
  • 47
  • 61
35
votes
3 answers

How to read mp4 video to be processed by scikit-image?

I would like to apply a scikit-image function (specifically the template matching function match_template) to the frames of a mp4 video, h264 encoding. It's important for my application to track the time of each frame, but I know the framerate so I…
gaggio
  • 545
  • 2
  • 5
  • 12
30
votes
6 answers

Skimage: how to show image

I am novice at skimage and I try to show the image in my ipython notebook:\ from skimage import data, io coins = data.coins() io.imshow(coins) But I see only the following string: Can anyboby explain…
Tehada
  • 491
  • 1
  • 6
  • 11
29
votes
7 answers

Interactive pixel information of an image

Short version: is there a Python method for displaying an image which shows, in real time, the pixel indices and intensities? So that as I move the cursor over the image, I have a continually updated display such as pixel[103,214] = 198 (for…
Alasdair
  • 1,300
  • 4
  • 16
  • 28
25
votes
1 answer

skimage: Why does rgb2gray from skimage.color result in a colored image?

When I tried to convert the image to gray scale using: from skimage.io import imread from skimage.color import rgb2gray mountain_r = rgb2gray(imread(os.getcwd() + '/mountain.jpg')) #Plot import matplotlib.pyplot as…
kwotsin
  • 2,882
  • 9
  • 35
  • 62
23
votes
6 answers

Alternative to scipy.misc.imresize()

I want to use an old script which still uses scipy.misc.imresize() which is not only deprevated but removed entirely from scipy. Instead the devs recommend to use either numpy.array(Image.fromarray(arr).resize()) or skimage.transform.resize(). The…
Artur Müller Romanov
  • 4,417
  • 10
  • 73
  • 132
22
votes
6 answers

How to crop or remove white background from an image

I am trying to compare images using OpenCV and Python. Consider these images: Both feature an identical pair of shoes, set to a white background. The only difference being that the first has a taller background than the second. I want to know…
Tuhin Sah
  • 235
  • 1
  • 3
  • 8
1
2 3
99 100