Questions tagged [scikit-image]

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

scikit-image
Filter by
Sorted by
Tagged with
2 votes
2 answers
70 views

Summing a Python Dictionary that Has Two Nested Keys Per Value

My Python script is designed to count the number of areas at or above a prescribed threshold using SciKit Image. It also computes the areas of these regions, and their average intensity. However, it ...
0 votes
0 answers
754 views

Filter footprint array has incorrect shape for skimage.filters.median

skimage.filters.median has no problems for Fig 1, but errors of filter footprint array has incorrect shape for Fig 2. What is the reason? from skimage import io, filters import skimage.morphology as ...
-6 votes
2 answers
108 views

how to change the particuler elements of an array

I have an array for an example: import numpy as np data=np.array([[4,4,4,0,1,1,1,1,1,1,0,0,0,0,1], [3,0,1,0,1,1,1,1,1,1,1,1,1,1,0], [6,0,0,0,1,1,1,1,1,1,1,1,1,1,0], ...
6 votes
2 answers
7k views

Color correction using opencv and color cards

I was looking for automated ways of doing some basic color corrections and I came across this blog post. https://www.pyimagesearch.com/2021/02/15/automatic-color-correction-with-opencv-and-python/ ...
0 votes
0 answers
115 views

Create a fast filter with a custom function on a numpy array

I would like to implement a filter on numpy array which compute locally (given a footprint) the average distance to the central pixel. This function is similar to the local standard deviation, but ...
1 vote
2 answers
19k views

scikit-image Gabor filter error: `filter weights array has incorrect shape`

Input is a greyscale image, converted to a 130x130 numpy matrix. I always get the error: Traceback (most recent call last): File "test_final.py", line 87, in <module> a._populate_gabor() ...
1 vote
1 answer
958 views

How to get the long & short axis OR get length of mask at a point orthogonal to the feret diameter?

I'm trying to measure a polygon mask's longest diameter (feret diameter) while also getting the length of the orthogonal line from the center of the feret diameter. Diagram of what I'm trying to do ...
0 votes
1 answer
2k views

'RegionProperties' object has no attribute 'feret_diameter_max'

I'm having some issues with calculating Feret diameter with skimage. All other prop regions (area, centroid, etc.) work fine so I am not sure what the issue is? I'm on Phyton 3.8.3. and skimage 0.17.2 ...
0 votes
1 answer
283 views

Measuring the Feret diameter of multiple particles per TIFF image

I am looking to measure the minimum and maximum diameter of multiple particles (groups) in a TIFF image. This is my current code: from PIL import Image import numpy as np from skimage import measure ...
3 votes
2 answers
1k views

How do I use Piecewise Affine Transformation to straighten curved text line/ contour?

Consider the following image: and the following bounding contour( which is a smooth version of the output of a text-detection neural network of the above image ), so this contour is a given. I need ...
0 votes
0 answers
570 views

Where exactly to use Morphological Operations (Dilation, Erosion, Opening or Closing) while binarizing image using OpenCv

I have built a code for Image Binarization and it works kind of well but the texts in my binary images either get too big or there's some white noise in them. What I want to do it to try Erosion, ...
0 votes
1 answer
556 views

How to get center of irregular shape with skimage regionprops?

I'm using Skimage regionprops to find the center of objects, and then opencv to write text in the middle of the object. However, some of the objects are irregular in shape and the centroid coordinates ...
0 votes
1 answer
121 views

Issue with accessing masks when training Unet model (valueError) coming up in case of scikit

As can be seen below, the following code was used when training a Unet model through Spyder. I ended up taking a look at a Youtube tutorial by DigitalSreeni,in episode 208 where he looked at multi ...
3 votes
1 answer
756 views

Setting a list of (x,y) cooordinates into an array so polygons are drawn

I have some code that prints out a list of coordinates (stored in points f=open('139cm_2000_frame27.json') data=json.load(f) shapes=data["shapes"] for i in shapes: print(i['label']) ...
0 votes
1 answer
794 views

Input array must have a shape == (..., 3)), got (299, 299, 4)

I am using a pretrained resnet50 model to validate some classes. I am using LIME to test how the model is testing this data as well. However, some of the images are not RGB and may be different ...
0 votes
1 answer
38 views

Why boolean output turns to numerical output once I create a loop?

I am using skiimage library, I got it works correctly for different input files data. Here the code that is working: To explain it briefly, alpha_time is a level set function structured as [time,x,y,z]...
0 votes
1 answer
317 views

Why does the skimage slic function return a grayscale output for an RGB input?

I try to use the implemented library slic from python on an RGB image. However, even if I set the multichannel to True, the output shape is (X, X), not (X, X, 3), and the saved image is simply a gray ...
3 votes
5 answers
4k views

Skimage : rotate image and fill the new formed background

When rotating an image using import skimage result = skimage.transform.rotate(img, angle=some_angle, resize=True) # the result is the rotated image with black 'margins' that fill the blanks The ...
2 votes
1 answer
431 views

"view_as_windows" from skimage but in Pytorch

Is there any Pytorch version of view_as_windows from skimage? I want to create the view while the tensor is on the GPU.
0 votes
1 answer
961 views

TypeError: load() missing 1 required positional argument: 'Loader' when importing felzenszwalb, slic, quickshift, watershed from skimage.segmentation

I was trying to run the simple test script of skimage for superpixels segmentation. However, when I executed the code (python -m src), I got this error: Traceback (most recent call last): File "...
2 votes
1 answer
605 views

Find number of islands and affected area in an image [duplicate]

I have the following problem that I wanted to solve using opencv or scikit-image. Suppose I have a "map" in the following form: 1 is ground 0 is water map = np.array([ [ 0., 0., 0., 0., 0.,...
2 votes
1 answer
288 views

Grab and plot 2D array's values crossed by a segment on matplotlib

Goal: Plot the values of a 2D array's cells crossed by a segment. How: With Matplotlib, plot the 2D array (with imshow), grab the coordinates of 2 points defining the segment (with plt.ginput()), and ...
0 votes
2 answers
201 views

how can i find intersection points of these axlines?

I want to extract the intersection point of these axlines, how can that be achieved ? I want to extract the points and use them for homography matrix. ####################### # Load and Show image # ##...
1 vote
0 answers
138 views

How to crop image on the detected houghlines?

I am developing a book spine detection solution. For that I am trying to crop the image using the hough lines detected. However I am stuck at this phase. Here's the code which I am using to detect the ...
2 votes
1 answer
284 views

Why is Local Binary Pattern affected by scaling?

I found that the local binary pattern in scikit-image is affected by re-scaling the image, but I was not expecting this. Since the LBP just involves greater/less than comparisons between nearby pixels,...
0 votes
1 answer
676 views

How to remove CT bed/shadows in a CT image with python?

I am working with 3D CT images and trying to remove the lines from the bed. A slice from the original Image: Following is my code to generate the mask: segmentation = morphology.dilation(image_norm, ...
2 votes
2 answers
8k views

merge two images with alpha channel

I have two images, one with and other without alpha channel. Thus, image A and B has a shape of (x,y,4) and (x,y,3) respectively. I want to merge both images in a single tensor using python, where B ...
5 votes
1 answer
7k views

Scikit image color filtering and changing parts of image to array

I want to do some Optical Mark Recognition using scikit-image. I am looking for 2 functions Lets say I have an image that looks like this: The way I would detect it is using filters to clean the ...
4 votes
2 answers
986 views

How could I separate cells from binary image

I have a binary image of cells. I want to use python to separate these cells individually. Each cell will save in an image. For example, I have 1000 cells, then the output will be 1000 images, each ...
0 votes
0 answers
436 views

Make an RGB mask. cv2.error: /io/opencv/modules/core/src/arithm.cpp:241: error: (-215) (mtype == 0 || mtype == 1)

l did superpixel segmentation where l get 50 different regions. Now l would like to assign for each region mask a different RGB color. Since l have 50 segments, l would like to get 50 different ...
1 vote
0 answers
626 views

Images tracking using SLIC superpixels

l have a a set of 250 images. From each image l apply SLIC superpixel algorithm. Now, given superpixels of each image, l would like to track the superpixels of image 1 in image 2. How to do that ? ...
5 votes
1 answer
6k views

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 ...
4 votes
0 answers
370 views

Block Artifact Grid of an Image

I have been reading this paper where they have used Error Level Analysis (ELA) and Block Artifact Grid (BAG). I have found a way to do the ELA using skimage from here I want a final output of the BAG ...
0 votes
1 answer
113 views

How to label regions that they do not have same values?

I have stacked 5 probability map in a numpy array (a with the shape 256x256x5), that I have stacked them and then I get the argmax of all of them that final output is show by different 5 colors, ...
4 votes
1 answer
429 views

Reduce an image to paths defined by a collection of points

I'm currently trying to represent an image like the one below as a point defined path. Every "trace" should be a separate path. See picture below The thing I'm trying to do right now is ...
4 votes
2 answers
3k views

pytorch dataloader stucked if using opencv resize method

I can run all the cells of the tutorial notebook of Pytorch about dataloading (pytorch tutorial). But when I use OpenCV in place of Skimage to resize the image, the dataloader gets stuck, i.e nothing ...
1 vote
0 answers
2k views

Handwritten signature similarity match in python

I am trying to solve problem where i have two digital handwritten signature i have to find similarity percentage between them Below is the code import cv2 from skimage.metrics import ...
0 votes
1 answer
398 views

overlapping skeletons of images

I did sketalization of images using morphology module of skimage. The output seems quite cool but I want the output to somehow be over my threshold/binary output so that I can confirm whether the ...
2 votes
1 answer
754 views

Finding powerlines in LIDAR point clouds with RANSAC

I'm trying to find powerlines in LIDAR points clouds with skimage.measures ransac() function. This is my very first time meddling with these modules in python so bear with me. So far all I knew how to ...
1 vote
1 answer
2k views

How to convert cv2 image to skimage?

I am reading an image from a camera that comes in cv2.COLOR_RGB2BGR format. Below is a temporary work around for what I am trying to achieve: import cv2 from skimage import transform, io ... _, img = ...
1 vote
1 answer
326 views

Wrong pixel value scaling in skimage.util (alternative for bytescaling in Scipy)

With the newest version of SciPy the bytescale() function is removed. So I tried an alternative with scikit-image. While bytescale()(scipy) converts an uint16 image (.tif) correctly scaled to an uint8 ...
1 vote
1 answer
242 views

Skimage RANSACRegressor At least 2 input points needed

scikit-image : 0.19.3 code to reproduce error: from skimage.measure import LineModelND, ransac import numpy as np pts = np.array([[579,298], [604,276], [354,241], [156,240], [124,157], [625,105]]...
3 votes
1 answer
4k views

How to import Skimage to segment an image with watershed?

I'm trying to use Skimage to segment an image with watershed, but I always get this error. Do you have a solution please? AttributeError: module 'skimage.morphology' has no attribute 'watershed' ...
-1 votes
1 answer
762 views

How to remove small objects from a 3D binary mask

I want to remove the small connected object from my 3D volume in Python (i.e. objects having less than N adjacent pixels in 3D). I found a relevant example using OpenCV at this link, but the method ...
1 vote
1 answer
65 views

PIL selftests fine and can import __imaging, but still "Imaging is not installed" error

I'm running OS X 10.7.5 and have been trying for weeks to get PIL working. It installs and compiles fine, passes its selftest, and I can import __imaging without any errors. However, when I try and ...
0 votes
1 answer
534 views

Scikit-image GLIBCXX ImportError. Is the problem with skimage, Anaconda, or Ubuntu?

I am running a fairly cutting-edge Miniconda setup on Ubuntu 22.04. Getting Tensorflow GPU installed without pain is what sold me on Anaconda, but I'm not sure that it handles every situation well. ...
0 votes
0 answers
502 views

How to Enhance Image contrast and brightness

I have a input image and i want to improve contrast and brightness input image: After run my code result is: But finally image i want(Clarity filter in Windows 10 Photos app in edit mode you can use ...
0 votes
1 answer
157 views

Weight map for unique figure contours

I'm training a U-Net for extracting the area of buildings from satellite images. The results are not bad but I want to sharp the contours of the figures inside the image. In order to improve it, I'm ...
0 votes
1 answer
839 views

Remove small objects from binary image with skimage

I have the following binary image and I want to remove the spots with a value 0 inside the area of the pixels with value 1. I tried following code from the skimage package: im1 = morphology....
0 votes
0 answers
64 views

Group points in an array to perform operations on the whole group

I'm currently trying to make a program that takes a binary color image (https://i.stack.imgur.com/evmjG.jpg) and tells if any of the white dots are "covered" by something (i.e. some of the ...

1
4 5
6
7 8
39