watershed

Find peak (regions) in 2D data

风格不统一 提交于 2019-11-30 03:51:38
问题 I am looking to find peak regions in 2D data (if you will, grayscale images or 2D landscapes, created through a Hough transform). By peak region I mean a locally maximal peak , yet NOT a single point but a part of the surrounding contributing region that goes with it. I know, this is a vague definition, but maybe the word mountain or the images below will give you an intuition of what I mean. The peaks marked in red (1-4) are what I want, the ones in pink (5-6) examples for the "grey zone",

watershed segmentation opencv xcode

我只是一个虾纸丫 提交于 2019-11-29 02:37:53
I am now learning a code from the opencv codebook ( OpenCV 2 Computer Vision Application Programming Cookbook ): Chapter 5, Segmenting images using watersheds, page 131. Here is my main code: #include "opencv2/opencv.hpp" #include <string> using namespace cv; using namespace std; class WatershedSegmenter { private: cv::Mat markers; public: void setMarkers(const cv::Mat& markerImage){ markerImage.convertTo(markers, CV_32S); } cv::Mat process(const cv::Mat &image){ cv::watershed(image,markers); return markers; } }; int main () { cv::Mat image = cv::imread("/Users/yaozhongsong/Pictures/IMG_1648

watershed algorithm in matlab

旧街凉风 提交于 2019-11-28 23:55:50
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 Jonas 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 %# read image img = imread('http://i.stack.imgur.com/nFDkX.png'); %# normalize to 0...1 imgN = double

Shape recognition with numpy/scipy (perhaps watershed)

旧巷老猫 提交于 2019-11-28 18:26:51
My goal is to trace drawings that have a lot of separate shapes in them and to split these shapes into individual images. It is black on white. I'm quite new to numpy,opencv&co - but here is my current thought: scan for black pixels black pixel found -> watershed find watershed boundary (as polygon path) continue searching, but ignore points within the already found boundaries I'm not very good at these kind of things, is there a better way? First I tried to find the rectangular bounding box of the watershed results (this is more or less a collage of examples): from numpy import * import numpy

MatLab - Segmentation to separate touching objects in an image

帅比萌擦擦* 提交于 2019-11-28 11:40:23
I'm using the function regionprops to detect the number of trees on a image taked by drone. First I removed the ground using Blue NDVI: Image with threshold: Then I used the function regionprops to detect the number of trees on image: But there are a problem on region 15, because all trees on that region are connected and it detects as one tree. I tried to separate the trees on that region using Watershed Segmentation , but its not working: Am I doing this the wrong way? Is there a better method to separate the trees? If anyone can help me with this problem I will appreciate. Here is the

watershed segmentation opencv xcode

喜欢而已 提交于 2019-11-27 16:54:16
问题 I am now learning a code from the opencv codebook ( OpenCV 2 Computer Vision Application Programming Cookbook ): Chapter 5, Segmenting images using watersheds, page 131. Here is my main code: #include "opencv2/opencv.hpp" #include <string> using namespace cv; using namespace std; class WatershedSegmenter { private: cv::Mat markers; public: void setMarkers(const cv::Mat& markerImage){ markerImage.convertTo(markers, CV_32S); } cv::Mat process(const cv::Mat &image){ cv::watershed(image,markers);

MatLab - Segmentation to separate touching objects in an image

孤者浪人 提交于 2019-11-27 06:25:57
问题 I'm using the function regionprops to detect the number of trees on a image taked by drone. First I removed the ground using Blue NDVI: Image with threshold: Then I used the function regionprops to detect the number of trees on image: But there are a problem on region 15, because all trees on that region are connected and it detects as one tree. I tried to separate the trees on that region using Watershed Segmentation, but its not working: Am I doing this the wrong way? Is there a better

How to define the markers for Watershed in OpenCV?

好久不见. 提交于 2019-11-26 02:40:55
问题 I\'m writing for Android with OpenCV. I\'m segmenting an image similar to below using marker-controlled watershed, without the user manually marking the image. I\'m planning to use the regional maxima as markers. minMaxLoc() would give me the value, but how can I restrict it to the blobs which is what I\'m interested in? Can I utilize the results from findContours() or cvBlob blobs to restrict the ROI and apply maxima to each blob? 回答1: First of all: the function minMaxLoc finds only the