Questions tagged [mahotas]

Mahotas is a set of functions for image processing and computer vision in Python.

Mahotas is a set of functions for image processing and computer vision in Python.

It is completely based on numpy arrays as its datatype. It has its heavy routines implemented in clean C++ in a way that is both very clean, type independent (using templates), and fast.

Full documentation is at https://mahotas.readthedocs.io/

Code repository is at https://github.com/luispedro/mahotas

54 questions
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
5
votes
2 answers

Image Conversion between cv2, cv, mahotas, and SimpleCV

I am having to do a lot of vision related work in Python lately, and I am facing a lot of difficulties switching between formats. When I read an image using Mahotas, I cannot seem to get it to cv2, though they are both using numpy.ndarray. SimpleCV…
Subhamoy S.
  • 6,566
  • 10
  • 37
  • 53
5
votes
1 answer

Unable to locate freeimage after install of mahotas in Python

Hi I am new to Python and am following the Python Image Tutorial. The following executes with no errors after installing the packages described in the tutorial import numpy import scipy import pylab import pymorph import mahotas from scipy import…
Michael
  • 75
  • 1
  • 5
5
votes
2 answers

Image reconstruction based on Zernike moments using mahotas and opencv

I heard about mahotas following this tutorial in the hope of finding a good implementation of Zernike polynomials in python. It couldn't be easier. However, I need to compare the Euclidean difference between the original image and the one…
Frederico Schardong
  • 1,946
  • 6
  • 38
  • 62
5
votes
1 answer

Detect objects on a white background in Python

I'm trying to use Python to detect how many objects are on a white surface. An example image is found at the end of this post. I'm wondering how I should do this, mainly because the background is white and most of the time it gets detected as…
E. V. d. B.
  • 815
  • 2
  • 13
  • 30
5
votes
3 answers

Python module Mahotas thresholding issue

I'm using this tutorial http://pythonvision.org/basic-tutorial However when I pass a png image: T = mahotas.thresholding.otsu(dna) I get an error: TypeError: mahotas.otsu: This function only accepts integer types (passed array of type…
Angel Cloudwalker
  • 2,015
  • 5
  • 32
  • 54
3
votes
1 answer

Reading and writing images with Mahotas

I'm trying to write an image with Mahotas and finding it strangely difficult. img = mahotas.imread('foo.png', True) mahotas.imsave('bar.png', img) the error I'm gettings is: ValueError: mahotas.freeimage: cannot write arrays of given type and…
Ralphleon
  • 3,968
  • 5
  • 32
  • 34
3
votes
2 answers

Background removal/masking in Python using edge detection and scikit-image

I'd like to create two images from a source RAW image, a Canon CR2 in this case. I've got the RAW conversion sorted and some of the processing. My final images need to be a PNG with an alpha mask and a 95% quality JPG with the alpha area instead…
robeastham
  • 41
  • 1
  • 4
3
votes
2 answers

error while installing mahotas to python 2.7

I am using command prompt for installing Manhotas 1.1.0. I have mahotas in zip file and I have extracted it out. My procedure was:' python setup.py install' . But,its giving me error: Thanks in advance!
varsha_holla
  • 852
  • 7
  • 23
  • 41
2
votes
0 answers

Specifiyng color of polygons drawn by mahotas.polygons

I am using this code with open('frame 0001.json') as json_file: json_dict = json.load(json_file) shape = (1920, 1052) canvas = np.zeros(shape) for obj in json_dict["objects"]: pts = [((round(p["x"] - 1)), (round(p["y"]))) for…
Jolanthan
  • 81
  • 7
2
votes
1 answer

Mahotas library for GLCM calulation and window size

I am using mahotas library to do texture analysis (GLCM) on a satellite image (250 x 200 pixels). GLCM calculations are carried out within a window size. So, for two adjacent positions of the sliding window we need to compute two co-occurrence…
Johny
  • 319
  • 3
  • 12
2
votes
2 answers

Python: taking the GLCM of a non-rectangular region

I have been using the SLIC implementation of skimage to segment images in superpixels. I would like to use GLCMs to extract additional features from these superpixels for a classification problem. These superpixels are not rectangular. In MATLAB you…
Habba
  • 475
  • 2
  • 5
  • 15
2
votes
1 answer

What are the meaning of the returned values of mahotas.features.zernike_moments

I used this function below to calculate the zernike moments of my image. mahotas.features.zernike_moments(im, radius=150, degree=8, cm={center_of_mass(im)}) I set degree=8 and get 25 returned values. Can someone explain to me why I got 25 values…
Rosy
  • 821
  • 2
  • 7
  • 14
2
votes
0 answers

Using mahotas and imread package in python

Im interested in using the Mahotas package for python, unfortunately i'm experiencing some problems installing or running it. When I run: sudo pip install mahotas I get: Requirement already satisfied (use --upgrade to upgrade): mahotas in…
Bert Coerver
  • 252
  • 1
  • 9
2
votes
3 answers

microscopy image segmentation: bacteria segmentation with python

I am trying to segment some microscopy bright-field images showing some E. coli bacteria. The picture I am working with resembles this one (even if this one is obtained with phase contrast): my problem is that after running my segmentation function…
JacoSolari
  • 1,226
  • 14
  • 28
1
2 3 4