label region in bi-level image with python - python

I want to tag clusters of neighboring pixels from a 2D binary matrix in python.
Basically, I am trying to find something similar to the idl function label_region
http://star.pst.qub.ac.uk/idl/LABEL_REGION.html
Do you have any advice?
Thanks

the answer is here http://pythonvision.org/basic-tutorial
I used the function ndimage.label

Related

I want to obtain a mesh from a point cloud in python

I have some brain images in a ndarray vector whose size is (25,29,21).
I would like to obtain a mesh from that points cloud but i don't know how.
I need that just to use the zernike moments in this repository:
https://github.com/nipy/mindboggle/blob/bc10812979d42e94b8a01ad8f98b4ceae33169e5/mindboggle/shapes/zernike/zernike.py#L248
Because one of the imput parameters is faces that is a list of lists of 3 integers. Each list contains indices to vertices that form a triangle on a mesh. Does anyone of you know how can i obtain that from my point cloud in ndarray format?
Thanks in advance!
I looked for it on google but i didn't obtain nothing interesting to use. Can someone help me?

How to make Color gradient-weigthed distance image in opencv (python)

How to make Color gradient-weigthed distance in OpenCV for Python? For all my research that I am doing I am find just gradient distance without the color information, please can anyone know the path to it? Many thanks in advance
Image source.
*The objective is not doing Distance transformation alone, but doing it with color information (in grayscale)
I found the solution based on these papers:
https://www.researchgate.net/publication/257690553_Automatic_image_segmentation_of_nuclear_stained_breast_tissue_sections_using_color_active_contour_model_and_an_improved_watershed_method
https://www.researchgate.net/publication/260755668_A_color_and_shape_based_algorithm_for_segmentation_of_white_blood_cells_in_peripheral_blood_and_bone_marrow_images
Was just the merge of the two techniques, thank you all.

how to count point which based on projection of a set of coordinates

I have some data about a set of coordinates, like {(x=1, y=2), (x=3, y=4), ...}. I projected these coordinates on the picture. Then I would like to count these point in different position. My idea is below
First, separate the picture from several pixel parts based on 10 pixels.
Second, count the point inside the pixel box.
I am new in these area, and I use python a lot. I think this may be computer graphic problem.
I am not asking for a code solution. I just want to know which libraries or approaches that are related.
Anyone could give me a hint would be highly appreciated. Thanks.
Sure, your approach seems fine. You simply want to count the number of pixels in different image regions that you placed, correct?
I answered a question recently (with Python) that was giving an indication if there was a black pixel inside an image region. It could be easily modified to count pixels instead of simply finding one. Check it out here and modify your question or post a new one if you have code problems working it out.

Python: Extract GLGCM features

There is a type of texture features called GLGCM (Gray Level Gradient Based Co-occurrence Matrix) that captures information about how different image gradients co-occur with each other.
GLGCM is different from normal GLCM.
Can anyone help me find an implementation for GLGCM in Python?
I don't have access to the paper right now, so I am not sure about how the details are but, what if you use GLCM on gradient image normalized into 0-255 range?
Python implementation could be found in scikit-image library

image alignment with set points-python

I've been looking for a way to align at least two images in Python.
There are some very nice scripts out there, but I'd like a script that accepts the coordinates of a point in one image and use these coordinates to align the second(or more) image.
I'v been reading about phase correlation algorithms but I'd appreciate some help on how to use the coordinates of a user defined point.
Thank you!

Categories