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
5
votes
1 answer

Reproduce MATLAB's imgaborfilt in Python

I'm trying to reproduce the behaviour of the following MATLAB code in Python: % Matlab code wavelength = 10 orientation = 45 image = imread('filename.tif') % grayscale image [mag,phase] = imgaborfilt(image, wavelength, orientation) gabor_im = mag .*…
Adomas Baliuka
  • 1,384
  • 2
  • 14
  • 29
5
votes
3 answers

How to resize an image but maintain pixel values in sk-image?

I want to resize images. My images contain specific values [0, 1, 2, 7, 9]. After resizing, new values are introduced like 5 and whatnot. I want to prevent that. I'm currently using scikit image resize function. I've tried all interpolation flags…
Alex Deft
  • 2,531
  • 1
  • 19
  • 34
5
votes
1 answer

skimage.io.imread Versus cv2.imread

I am using and familiar with cv2, today I was giving a try with skimage. I was trying to read an image using skimage and cv2. It seems that they both read the image perfectly. But when I plot histograms of the image but read through different…
Arafat Hasan
  • 2,811
  • 3
  • 21
  • 38
5
votes
3 answers

how to save an array representing an image with 40 band to a .tif file

I have an array with 600×600×40 dimension that each band(from 40 band) represent a 600×600 image I want to save it to a multiple band .tif image. I have tried this functions from scikit-image and openCV but they can not save more than 3 band(as…
user10482281
  • 53
  • 1
  • 5
5
votes
1 answer

When reading 4-channel tif file, value different from SKIMAGE, TIFFFILE and so on

I know the opencv got a BGR order, but in my experiment, not only the order but also the values are totally messed import cv2 as cv import tifffile as tiff import skimage.io img_path = r"C:\test\pics\t100r50s16_1_19.tif" c =…
Ziyi He
  • 51
  • 3
5
votes
4 answers

Python: cannot import name 'rgb2gray' from 'skimage.color'

When I try: >>> from skimage import io I get at the end the following: from ..color import rgb2gray ImportError: cannot import name 'rgb2gray' from 'skimage.color'…
Safiya
  • 185
  • 1
  • 3
  • 11
5
votes
1 answer

Compare the LBP in python

I generated a texture image like this I have to compare two textures. I have used histogram comparison method. image_file = 'output_ori.png' img_bgr = cv2.imread(image_file) height, width, channel = img_bgr.shape hist_lbp = cv2.calcHist([img_bgr],…
5
votes
3 answers

map(float for Resampling DICOM images throwing Multivalue error

I am getting "can only concatenate list (not "MultiValue") to list" highlighting map (float portion, while running below resampling, this code is very commonly used throughout image segmentation like lungs etc, I am thinking maybe this is issue with…
1369
  • 61
  • 1
  • 4
5
votes
2 answers

How could I sort the coordinates according to the serpentine in the image?

In this following binary image, I have been able to get the list of coordinates where the value is 1. The coordinates are stored from left to right. Question: How could I sort the list of coordinates in such a way that they come one after the other…
Jeremy
  • 189
  • 4
  • 14
5
votes
1 answer

Difference between cv2, scipy.misc and skimage

What is the main difference between cv2.imread / resize/ imwrite scipy.misc.imread / imresize/ imsave skimage.io.imread / skimage.transform.resize / skimage.io.imsave and how to decide which one to use? I know cv2 and skimage have different…
Panfeng Li
  • 3,321
  • 3
  • 26
  • 34
5
votes
2 answers

scikit-image fails to install

I'm trying to install the scikit-image package on my Windows 7 64-bit machine with python 3.5. While installing scikit, the requirements are met: Requirement already satisfied: six>=1.7.3 in…
Noltibus
  • 1,300
  • 3
  • 12
  • 34
5
votes
1 answer

Local mean filter of a numpy array with missing data

I'd like to make a local mean filter of an image stored as a numpy array. The image has some missing pixels near the edges, represented with a valid mask (a bool array). I could use skimage.filters.rank, but my images are outside of the [-1, 1]…
fouronnes
  • 3,838
  • 23
  • 41
5
votes
1 answer

ValueError: Images of type float must be between -1 and 1

I'm trying a simple disk filter applied to a fits file: from skimage.morphology import disk from skimage.filters.rank import median import numpy as np import matplotlib.pyplot as plt from astropy.io import fits # Open data files for image and…
Jim421616
  • 1,434
  • 3
  • 22
  • 47
5
votes
3 answers

fastest way to select 7*7 neighbor pixels for every pixel in an image in Python

need to read an image as an array and for each pixel select 7*7 neighbor pixels then reshape it and put as a first row of training set: import numpy as np from scipy import misc face1=misc.imread('face1.jpg') face1 dimensions are (288, 352,…
chessosapiens
  • 3,159
  • 10
  • 36
  • 58
5
votes
3 answers

Python Histogram of Oriented Gradients

I am trying to implement this version of Histogram of Oriented Gradients(HOG). My code is below. The only difference in my code is that I've used opencv to read the image and convert it to grayscale. import cv2 import matplotlib.pyplot as plt from…