image-segmentation

How to connect broken lines in a binary image using Python/Opencv

两盒软妹~` 提交于 2019-11-30 07:17:38
How can I make these lines connect at the target points? The image is a result of a skeletonization process. I'm trying to segment each line as a region using Watershed Transform. MikeE 's answer is quite good: using dilation and erosion morphological operations can help a lot in this context. I want to suggest a little improvement, taking advantage of the specific structure of the image at hand. Instead of using dilation/erosion with a general kernel, I suggest using a horizontal kernel that will connect the endpoints of the horizontal lines, but will not connect adjacent lines to one another

Can Caffe classify pixels of an image directly?

不羁的心 提交于 2019-11-30 07:12:30
I would like to classify pixels of an image to "is street" or "is not street". I have some training data from the KITTI dataset and I have seen that Caffe has an IMAGE_DATA layer type. The labels are there in form of images of the same size as the input image. Besides Caffe, my first idea to solve this problem was by giving image patches around the pixel which should get classified (e.g. 20 pixels to the top / left / right / bottom, resulting in 41×41=1681 features per pixel I want to classify. However, if I could tell caffe how to use the labels without having to create those image patches

watershed algorithm in matlab

无人久伴 提交于 2019-11-30 06:59:47
问题 anyone knows how to write a function in matlab to segment the cells and compute the average cell area using the watershed algorithm? any help would be much appreciated. Thank you! Here is an image of yeast cells 回答1: Here's one way to segment the image using watershed. There's plenty more you could do (e.g. fuse cells with two nuclei if they haven't completed cytokinesis yet), but the steps below should give you a first idea. (1) Determine cell-background threshold, cell-nucleus threshold %#

scipy signal find_peaks_cwt not finding the peaks accurately?

有些话、适合烂在心里 提交于 2019-11-30 06:31:43
问题 I've got a 1-D signal in which I'm trying to find the peaks. I'm looking to find them perfectly. I'm currently doing: import scipy.signal as signal peaks = signal.find_peaks_cwt(data, np.arange(100,200)) The following is a graph with red spots which show the location of the peaks as found by find_peaks_cwt() . As you can see, the calculated peaks aren't accurate enough. The ones that are really important are the three on the right hand side. My question: How do I make this more accurate?

Finding the local maxima/peaks and minima/valleys of histograms

谁都会走 提交于 2019-11-30 04:13:10
Ok, so I have a histogram (represented by an array of ints), and I'm looking for the best way to find local maxima and minima. Each histogram should have 3 peaks, one of them (the first one) probably much higher than the others. I want to do several things: Find the first "valley" following the first peak (in order to get rid of the first peak altogether in the picture) Find the optimum "valley" value in between the remaining two peaks to separate the picture I already know how to do step 2 by implementing a variant of Otsu. But I'm struggling with step 1 In case the valley in between the two

Segmentation for connected characters

无人久伴 提交于 2019-11-30 04:05:07
How can I segment if the characters are connected? I just tried using watershed with distance transform (http://opencv-code.com/tutorials/count-and-segment-overlapping-objects-with-watershed-and-distance-transform/ ) to find the number of components but it seems that it does not perform well. It requires the object to be separated after a threshold in order to perform well. Having said so, how can I segment the characters effectively? Need helps/ideas. As attached is the example of binary image. An example of heavily connected. Ans: @mmgp this is my o/p I believe there are two approaches here:

Gaussian Mixture Models of an Image's Histogram

◇◆丶佛笑我妖孽 提交于 2019-11-29 19:51:38
问题 I am attempting to do automatic image segmentation of the different regions of a 2D MR image based on pixel intensity values. The first step is implementing a Gaussian Mixture Model on the image's histogram. I need to plot the resulting gaussian obtained from the score_samples method onto the histogram. I have tried following the code in the answer to (Understanding Gaussian Mixture Models). However, the resulting gaussian fails to match the histogram at all. How do I get the gaussian to

Connected Character segmentation in OpenCV

爱⌒轻易说出口 提交于 2019-11-29 15:16:13
问题 What is a good method to segment characters that are united as in the following figure, knowing that: characters have this font, but the font size varies based on the image size only isolated groups of characters from the image are connected Also, how can i detect if in a given bounding box, there are 2 or more letters which are connected? I tried with checking for width > height for detecting connected characters but it doesn't work for the blue groups in the image. I also tried a

Counting the squama of lizards

本小妞迷上赌 提交于 2019-11-29 09:38:56
A biologist friend of mine asked me if I could help him make a program to count the squama (is this the right translation?) of lizards. He sent me some images and I tried some things on Matlab. For some images it's much harder than other, for example when there are darker(black) regions. At least with my method. I'm sure I can get some useful help here. How should I improve this? Have I taken the right approach? These are some of the images. I got the best results by following Image Processing and Counting using MATLAB . It's basically turning the image into Black and white and then threshold

Find dominant color on an image

家住魔仙堡 提交于 2019-11-29 08:24:38
问题 I want to find dominant color on an image. For this, I know that I should use image histogram. But I am not sure of image format. Which one of rgb, hsv or gray image, should be used? After the histogram is calculated, I should find max value on histogram. For this, should I find below maximum binVal value for hsv image? Why my result image contains only black color? float binVal = hist.at<float>(h, s); EDIT : I have tried the below code. I draw h-s histogram. And my result images are here. I