watershed

OpenCV image segmentation in C++ using Watershed

无人久伴 提交于 2021-02-18 08:11:14
问题 Hi i'm currently writing a basic C++ application using the OpenCV library to segment the subject of the image from its background. The application reads in an image file and uses the watershed algorithm to generate a mask based on data it finds around the edges and data it finds in the centre of the image. (To start I created an image object that has an overall value of -1. Then I created a border around an empty image which has a value of 1. Then I created a rectangle roughly in the centre

Problem in image segmentation using watershed on android

耗尽温柔 提交于 2020-06-17 14:18:26
问题 I am developing an application that segments images of wounds using the watershed algorithm. For this, the user draws a line in the internal area of ​​the wound (region of interest) and another drawing in the background. With that, I pass the coordinates of this drawing to the watershed to perform the segmentation. I used this code in python to guide me through this step. However, in addition to not performing the correct segmentation, the black / white image is being saved in a different

Image segmentation using segment seeds watershed in android

旧巷老猫 提交于 2020-05-20 10:53:08
问题 I am developing a mobile application that performs the segmentation of wound images. I would like to use the watershed for segmentation of images with the use of the mark of the region of interest made by the user. The user draws around the region of the wound so that the coordinates can be passed to the seeds of the watershed. In this link I saw how this is done using the mouse click, I would like someone to help me do this for android. Because I have no idea how to do it. In the case of my

Image segmentation using segment seeds watershed in android

烂漫一生 提交于 2020-05-20 10:53:08
问题 I am developing a mobile application that performs the segmentation of wound images. I would like to use the watershed for segmentation of images with the use of the mark of the region of interest made by the user. The user draws around the region of the wound so that the coordinates can be passed to the seeds of the watershed. In this link I saw how this is done using the mouse click, I would like someone to help me do this for android. Because I have no idea how to do it. In the case of my

Image segmentation using segment seeds watershed in android

眉间皱痕 提交于 2020-05-20 10:52:07
问题 I am developing a mobile application that performs the segmentation of wound images. I would like to use the watershed for segmentation of images with the use of the mark of the region of interest made by the user. The user draws around the region of the wound so that the coordinates can be passed to the seeds of the watershed. In this link I saw how this is done using the mouse click, I would like someone to help me do this for android. Because I have no idea how to do it. In the case of my

Find Contours after Watershed opencv

人走茶凉 提交于 2020-05-13 14:03:12
问题 I have some troubles with part of my code. I would like to find contours after cv.Watershed algorithm in Python. To be honest, I don't know how to do it. This is my code : kernel = np.ones((3, 3), np.uint8) # sure background area sure_bg = cv2.dilate(image, kernel, iterations=5) opening = cv2.morphologyEx(image, cv2.MORPH_OPEN, kernel, iterations=2) # Finding sure foreground area dist_transform = cv2.distanceTransform(opening, cv2.DIST_L2, 3) ret, sure_fg = cv2.threshold(dist_transform, 0.4 *

Shape recognition with numpy/scipy (perhaps watershed)

萝らか妹 提交于 2019-12-29 03:22:08
问题 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

Watershed using c# or c++

时光总嘲笑我的痴心妄想 提交于 2019-12-23 20:56:27
问题 I am trying to convert the Matlab function watershed into C# or C++. I tried to use this code but CvFindContours returns NULL with this image. I also tried to use this implementation but I had issues with FilterGrayToGray . Does anyone knows how I can solve my problems or how I can calculate watershed on my image? Can someone explain me more precisely meyers flood algorithm for watershed? 回答1: Have you looked at the watershed algorithm provided by OpenCV? Also, here is an example of how to

OpenCV Watershed : 4 point connectivity

。_饼干妹妹 提交于 2019-12-23 04:45:38
问题 I am writing a code for watershed in OpenCV. But i want the watershed boundaries to be 4 point connected and not 8 point. Currently this is the interface: void watershed(InputArray image, InputOutputArray markers) Does anybody have any solution for this? Also, is there any simple way to perform morphological watershed in opencv for automatic over-segmentation, the current one takes user input? 回答1: OpenCV help for watershed does not explicitly explain the connectivity used in the function. It

OpenCV Watershed segmentation miss some objects

戏子无情 提交于 2019-12-13 05:58:56
问题 My code is the same as this tutorial. When I see the result image after using cv::watershed() , there is a object(upper-right) that I want to find out, but it's missing. There are indeed six marks in image after using cv::drawContours() . Is this normal because the inaccuracy of the watershed algorithm exist? Here is part of my code: Mat src = imread("result01.png"); Mat gray; cvtColor(src, gray, COLOR_BGR2GRAY); Mat thresh; threshold(gray, thresh, 0, 255, THRESH_BINARY | THRESH_OTSU); //