Questions tagged [scikit-image]

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

scikit-image
Filter by
Sorted by
Tagged with
93 votes
12 answers
350k views

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 ...
user583088's user avatar
  • 1,047
76 votes
7 answers
56k views

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. ...
John's user avatar
  • 845
64 votes
6 answers
71k views

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 ...
hans-t's user avatar
  • 3,183
64 votes
4 answers
53k views

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 ...
jimbotron's user avatar
  • 665
62 votes
9 answers
123k views

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, ...
user961627's user avatar
  • 12.6k
60 votes
4 answers
140k views

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 ...
Nikhith Tayambhath's user avatar
56 votes
7 answers
86k views

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" ...
postgres's user avatar
  • 2,252
44 votes
2 answers
26k views

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 ...
Alex's user avatar
  • 4,166
39 votes
4 answers
40k views

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(...
Om Sao's user avatar
  • 7,362
35 votes
3 answers
59k views

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 ...
gaggio's user avatar
  • 545
30 votes
7 answers
55k views

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: <matplotlib....
Tehada's user avatar
  • 501
29 votes
7 answers
38k views

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 ...
Alasdair's user avatar
  • 1,314
25 votes
1 answer
26k views

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 ...
kwotsin's user avatar
  • 2,903
25 votes
2 answers
23k views

libraries mkl_rt, openblas, lapack not found while installing scipy - How to change flags for libraries

I am new to python and pip ecosystem. I am trying to install scikit-image and it is installing scipy as a dependency I suppose. I am using macOS 11.1 and I know that support for this version is not ...
G Patel's user avatar
  • 351
24 votes
3 answers
15k views

Extract blocks or patches from NumPy Array

I have a 2-d numpy array as follows: a = np.array([[1,5,9,13], [2,6,10,14], [3,7,11,15], [4,8,12,16]] I want to extract it into patches of 2 by 2 sizes with ...
Borys's user avatar
  • 1,403
23 votes
6 answers
37k views

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 ...
Tuhin Sah's user avatar
  • 245
23 votes
6 answers
39k views

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(...
Artur Müller Romanov's user avatar
20 votes
2 answers
7k views

Feature extraction and take color histogram

I am working on an image processing feature extraction. I have a photo of a bird in which I have to extract bird area and tell what color the bird has. I used canny feature extraction method to get ...
Sumeet Kumar Yadav's user avatar
18 votes
5 answers
57k views

How to invert black and white with scikit-image?

I read an image with ndimage, which results in a binary image like this: I would like to invert the image such that white turns into black, and vice versa. Help is appreciated.
Pamungkas Jayuda's user avatar
17 votes
2 answers
54k views

Error with pip install scikit-image

I am using Windows 8.1 64 bit and Python 2.7. While trying to install scikit-image from the shell pip install scikit-image I have encountered this error: Command "python setup.py egg_info" failed ...
FaCoffee's user avatar
  • 7,759
16 votes
2 answers
23k views

Calculating entropy from GLCM of an image

I am using skimage library for most of image analysis work. I have an RGB image and I intend to extract texture features like entropy, energy, homogeneity and contrast from the image. Below are ...
Sreejith Menon's user avatar
14 votes
2 answers
5k views

Detecting comic strip dialogue bubble regions in images

I have an grayscale image of a comic strip page that features several dialogue bubbles (=speech baloons, etc), that are enclosed areas with white background and solid black borders that contain text ...
GreyCat's user avatar
  • 16.8k
13 votes
4 answers
16k views

Input image dtype is bool. Interpolation is not defined with bool data type

I am facing this issue while using Mask_RCNN to train on my custom dataset with multiple classes. This error occurs when I start training. This is what I get: /home/parth/anaconda3/envs/compVision/...
parth.singh71's user avatar
13 votes
2 answers
8k views

How to turn off skimage warnings

I want to turn off skimage UserWarning: I used this code but they are still enabled. with warnings.catch_warnings(): warnings.simplefilter("ignore") skimage.io.imsave
LearnToGrow's user avatar
  • 1,682
13 votes
1 answer
16k views

Skimage - Weird results of resize function

I am trying to resize a .jpg image with skimage.transform.resize function. Function returns me weird result (see image below). I am not sure if it is a bug or just wrong use of the function. import ...
Primoz's user avatar
  • 1,404
13 votes
2 answers
20k views

How can i convert images from scikit-image to opencv2 and other libraries?

I tried to find contour with cv2 python library in a skeletonized image created with scikit-image and i got this error: contours, hierarchy = cv2.findContours(skel,cv2.RETR_TREE,cv2....
improc's user avatar
  • 415
12 votes
3 answers
68k views

bins must increase monotonically

I just want to draw Matplotlib histograms from skimage.exposure but I get a ValueError: bins must increase monotonically. The original image comes from here and here my code: from skimage import io, ...
Aurélien Vasseur's user avatar
12 votes
2 answers
10k views

Convert boolean numpy array to pillow image

I'm currently working with image processing in python using the scikit-image library. I'm trying to make a binary image using sauvola thresholding with the following code: from PIL import Image ...
R.hagens's user avatar
  • 355
12 votes
1 answer
26k views

Save numpy array as image with high precision (16 bits) with scikit-image

I am working with 2D floating-point numpy arrays that I would like to save to greyscale .png files with high precision (e.g. 16 bits). I would like to do this using the scikit-image skimage.io package ...
tsawallis's user avatar
  • 1,035
12 votes
1 answer
4k views

Geometric warp of image in python

I would like to use python to perform a geometric transform over an image, to 'straighten' or rectify an image along a given curve. It seems that scikit-image ProjectiveTransform() and warp() are very ...
tiago's user avatar
  • 23k
12 votes
1 answer
995 views

Curve Fitting in 2D Images With Missing Data

I have split contours in a image and I want to connect them assuming they are parametrized curves. I was considering some curve fitting or curve tracing - but I do not know, how can I implement it. I ...
Foreen's user avatar
  • 379
11 votes
1 answer
33k views

How to extract green channel from RGB image in Python using Scikit-Image library?

I am extremely new to scikit-image (skimage) library in Python for image processing (started few minutes ago!). I have used imread to read an image file in a numpy.ndarray. The array is 3 dimensional ...
exAres's user avatar
  • 4,896
11 votes
1 answer
12k views

Is there a way to automatically correct the color balance?

I'm looking for a solution to automatically adjust the color balance? I would like to use the pictures for color analysis and comparison, therefore color balance is important. I was hoping a feature ...
Laurent R's user avatar
  • 792
11 votes
3 answers
7k views

Denoise and filter an image

I am doing a license-plate recognition. I have crop out the plate but it is very blurred. Therefore I cannot split out the digits/characters and recognize it. Here is my image: I have tried to ...
VICTOR's user avatar
  • 1,934
11 votes
1 answer
24k views

Which SSIM is correct : skimage.metrics.structural_similarity()?

Stackoverflow comunity, I'm trying to compute SSIM (Structural SIMilarity) between two bmp images on Python. I've found structural_similarity() function implemented in the skimage python library and ...
asendjasni's user avatar
  • 1,034
11 votes
1 answer
8k views

Scikit-image expanding active contour (snakes)

I followed the example from this link. However, the contour contracts from the init points. Is it possible to do contour that expands out? I want something like the image shown. The image on the left ...
matchifang's user avatar
  • 5,290
11 votes
1 answer
14k views

How to correctly use cv2.imwrite to save an image in openCV with cv2.selectROI

I am trying out OpenCV's ROI function. With this I am trying to crop out a section of an image that I load. After that I am trying to save the image as well as show it. Showing it is not much of a ...
TheTank's user avatar
  • 495
10 votes
4 answers
43k views

crop image in skimage?

I'm using skimage to crop a rectangle in a given image, now I have (x1,y1,x2,y2) as the rectangle coordinates, then I had loaded the image image = skimage.io.imread(filename) cropped = image(x1,y1,...
user824624's user avatar
  • 7,521
10 votes
4 answers
21k views

How to convert PNG to JPG in Python?

I'm trying to compare two images, one a .png and the other a .jpg. So I need to convert the .png file to a .jpg to get closer values for SSIM. Below is the code that I've tried, but I'm getting this ...
E K's user avatar
  • 129
10 votes
2 answers
25k views

scikit-image: write a ndarray to image with imsave, read back with imread, data don't match

here is the minimum working example: import numpy as np from skimage.io import imsave, imread image = np.array([[[109, 232, 173], [ 55, 35, 144]], [[ 43, 124, 185], ...
scott huang's user avatar
  • 2,588
10 votes
5 answers
18k views

Why is Gaussian Filter different between cv2 and skimage?

I've got an image that I apply a Gaussian Blur to using both cv2.GaussianBlur and skimage.gaussian_filter libraries, but I get significantly different results. I'm curious as to why, and what can be ...
waldol1's user avatar
  • 1,851
10 votes
6 answers
6k views

How to export contours created in scikit-image find_contours to shapefile or geojson?

I'm trying to export the results of the scikit-image.measure.find_contours() function as a shapefile or geojson after running on a satellite image. The output is an array like (row, column) with ...
Cate's user avatar
  • 431
10 votes
1 answer
22k views

The kernel appears to have died. It will restart automatically

When running: from skimage import data in jupyter notebook I always get the error : "The kernel appears to have died. It will restart automatically" I use: Anaconda 4.2.0 (64-bit) Python 3.5.2 ...
finlouarn's user avatar
  • 169
10 votes
1 answer
681 views

Finding pits in an image

One of my friend was working on following project: Below is the microscopic (SEM) image of the surface of stainless steel. But you can see, it is corroded a little bit (after long exposure to ...
Abid Rahman K's user avatar
9 votes
3 answers
10k views

Updating .Spec file for Pyinstaller gets reset

I am trying to modify the default .spec file created by Pyinstaller to include hidden imports and datas however everytime I run pyinstaller and specify the spec file like pyinstaller source.py spource....
Amr Abdu's user avatar
9 votes
2 answers
11k views

How to resize a labeled mask with nearest neighbor interpolation using scikit-image

I want to resize a labeled segmentation mask specifically with nearest neighbor interpolation. scikit-image has two relevant functions: resize and rescale But neither of these functions allow you to ...
cdeepakroy's user avatar
  • 2,203
9 votes
2 answers
25k views

Load custom image from file system in scikit-image

I am new to Python and I am trying to do the tutorial, shown on the official page. My goal is, to analyze a picture I've created, using the Local Otsu Threshold method. The code with an example ...
John's user avatar
  • 805
9 votes
2 answers
16k views

What to choose to begin with ComputerVision: Scikit-image or OpenCV? [closed]

My goal is to recognize specific types of traffic signs: red circles on video in real time.
ssssergey's user avatar
  • 253
9 votes
2 answers
35k views

OpenCV: RGB to YUV conversion, and showing channels like Wikipedia

I have been looking this conversion for a while. What are the ways of converting RGB image to YUV image and accessing Y, U and V channels using Python on Linux? (using opencv, skimage, or etc...) ...
hma's user avatar
  • 556
9 votes
2 answers
42k views

ellipse detection in opencv python

My image is here: i'm looking for a better solution or algorithm to detect the ellipse part (dish) in this photo and mask it in an other photo in Opencv. could you please give me some advice or ...
Mohammad Mostafavi's user avatar

1
2 3 4 5
39