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

How to apply a ScikitLearn classifier to tiles/windows in a large image

Given is a trained classifer in scikit learn, e.g. a RandomForestClassifier. The classifier has been trained on samples of size e.g. 25x25. How can I easily apply this to all tiles/windows in a large image (e.g. 640x480)? What I could do is (slow…
S.H
  • 875
  • 2
  • 11
  • 27
4
votes
1 answer

The interpretation of scikit-image SSIM (structural similarity image metric) negative values

I'm using scikit-image SSIM to compare the similarity between two images. The thing is that I get negative values, which are not favorable for my purpose. I understand that the range of SSIM values are supposed to be between -1 to 1, but I need to…
Miranda
  • 565
  • 1
  • 10
  • 27
4
votes
1 answer

dask and parallel hdf5 writing

In my code I save multiple processed images (numpy arrays) in parallel on an hdf5 file using mpi (mpi4py/h5py). In order to do that the file need to be opened using the driver=mpio option. import h5py from mpi4py import…
s1mc0d3
  • 523
  • 2
  • 15
4
votes
1 answer

scikit-image: mean filter changes dtype

I'm using the mean filter from sci-kit image. However, it seems to change the dtype of floating-point images to uint8, which leads to a problem when passing that again to other filter functions. As an illustration, consider the following…
Jarno
  • 6,243
  • 3
  • 42
  • 57
4
votes
1 answer

Intensity-weighted minimal path between 2 points in grayscale image

I want to determine minimum path between two specific points in an image, i.e. the path for which sum of distances between adjacent pixels weighted by pixel intensity (greyscale) will be minimized. For instance, this picture shows the input…
eudoxos
  • 18,545
  • 10
  • 61
  • 110
4
votes
2 answers

Scikit Image Marching Cubes

I'm using the Scikit Image implementation of the marching cubes algorithm to generate an isosurface. verts, faces,normals,values = measure.marching_cubes(stack,0) generates the following error: ValueError: need more than 2 values to unpack but…
KRS-fun
  • 696
  • 3
  • 9
  • 20
4
votes
1 answer

Regrid numpy array based on cell area

import numpy as np from skimage.measure import block_reduce arr = np.random.random((6, 6)) area_cell = np.random.random((6, 6)) block_reduce(arr, block_size=(2, 2), func=np.ma.mean) I would like to regrid a numpy array arr from 6 x 6 size to 3 x…
user308827
  • 21,227
  • 87
  • 254
  • 417
4
votes
1 answer

How to find polygon vertices from edge detection images?

1. The problem Given the images of a house roof, I am trying to find the contours of the roofs. I have labelled data available (as polygon vertices) which I interpolate and create the truth image which is shown below I use canny, hough-lines, LBP…
Irtaza
  • 599
  • 10
  • 18
4
votes
1 answer

rgb2gray not working, creating rainbow image

I'm trying to do data analysis on a series of photos, and when all photos are "changed" to grayscale from RGB, they are coming up as, well look: The standard Astronaut image as my system says it's grayscale Here's the code I'm using: import…
JDK
  • 43
  • 1
  • 4
4
votes
2 answers

Reordering image skeleton coordinates to make interp1d work better

For a school project I'm analyzing the centerlines of some C. elegans images. I've managed to generate a reasonable threshold and I'm using skimage.morphology.skeletonize to generate the centerline: Then I use np.nonzero to get the coordinates of…
elvirrey
  • 43
  • 4
4
votes
1 answer

Difference in processing time between map_block and map_overlap is it due to dask.array to np.array conversion?

Introduction I have an image stack (ImgStack) made of 42 planes each of 2048x2048 px and a function that I use for the analysis: def All(ImgStack): some filtering more filtering I determined that the most efficient way to process the array…
s1mc0d3
  • 523
  • 2
  • 15
4
votes
3 answers

scikit-image saves binary image as completely black image

So, I am trying to get binary image with scikit-image and save it on disk with the following code: gray = color.rgb2gray(img) thresh = filters.threshold_otsu(gray) binary = gray >= thresh io.imsave("./testout/" + img_name, binary) When I do…
kuzkokov
  • 90
  • 2
  • 9
4
votes
1 answer

reshaping a view of a n-dimensional array without using reshape

tl;dr Can I reshape a view of a numpy array from 5x5x5x3x3x3 to 125x1x1x3x3x3 without using numpy.reshape? I would like to perform a sliding window operation (with different strides) to a volume (size of MxMxM). The sliding window array can be…
pangyuteng
  • 1,749
  • 14
  • 29
4
votes
1 answer

Getting a negative of picture when copying numpy array values

I'm trying to copy an image by hand, but I when I do the result is a negative of the original image. I can't seem to find out why, so please help. This is the code: def copy(image): padded_image = np.ndarray(shape=image.shape) for i in…
4
votes
3 answers

Trouble importing filters using skimage

I have been using the Skimage package for quite a while in Python 2.7. Recently I upgrade my Ubuntu to 14.10 And now I can not import filters (used to be filter) from the Skimage package. Python 2.7.9 (default, Apr 2 2015, 15:33:21) [GCC 4.9.2]…
icypy
  • 3,062
  • 5
  • 25
  • 27