image-segmentation

Identifying different coin values from an image using MATLAB

此生再无相见时 提交于 2019-12-06 04:10:37
问题 I'm trying to identify the number of matches and coins of each value in a picture using MATLAB. Here is the starting picture, with matches and 4 different coin values. (5 small silver, 2 small gold, 2 big silver, 4 big gold coins) The output: Here's the code: close all; img = (imread('C:\Users\Torstein\Jottacloud\Skole\Visu\Prosjekt\sample_images\sample2.jpg')); img_gray = rgb2gray(img); % Filter image for easier edge detection m = 12; n = 12; img_filter = imfilter(img_gray, fspecial('average

How to calculate dice coefficient for measuring accuracy of image segmentation in python

折月煮酒 提交于 2019-12-06 03:49:55
问题 I have an image of land cover and I segmented it using K-means clustering. Now I want to calculate the accuracy of my segmentation algorithm. I read somewhere that dice co-efficient is the substantive evaluation measure. But I am not sure how to calculate it. I use Python 2.7 Are there any other effective evaluation methods? Please give a summary or a link to a source. Thank You! Edits: I used the following code for measuring the dice similarity for my original and the segmented image but it

Over-segmentation of Watershed algorithm

不羁岁月 提交于 2019-12-06 02:56:28
问题 I followed the 2-D Watershed example in Mathworks.com to separate the connected objects, like the image below: The code is summarize as: bw = imread('some_binary_image.tif'); D = -bwdist(~bw); D(~bw) = -Inf; L = watershed(D); The result is: The particle in the center has been separated into two. Are there any ways to avoid the over-segmentation here? Thanks, lennon310, chessboard does work well for most of my images, but there are still some cases that it doesn't. For example, the following

Segmenting circle-like shapes out of Binary Image

大憨熊 提交于 2019-12-05 22:37:14
问题 I have several binary images and my task is to segment circle-like shape. The circles are not perfect rounded circle, but all of them will look like circle. Here are some example images and what I need: As you can see from above, the left images are original images, and the right images are what I need to do. The circles intersect with other shapes, but I only want the circle, as indicated in red. The imaginary lines to close the circle will be required. What can I do in this case in Image

Floodfill segmented image in numpy/python

前提是你 提交于 2019-12-05 12:44:21
I have a numpy array which represents a segmented 2-dimensional matrix from an image. Basically, it's a sparse matrix with a bunch of closed shapes that are the outlines of the segments of the image. What I need to do is colorize the empty pixels within each closed shape with a different color/label in numpy. I know I could do this with floodfill in PIL but I'm trying not to have to convert the matrix back and forth from numpy to PIL. It would be nice if there was a function in someting like skimage or sklearn that could "auto-label" all the different closed regions of my matrix with a

Extract numbers from Image

假装没事ソ 提交于 2019-12-05 11:23:56
I have an image for mobile phone credit recharge card and I want to extract the recharge number only (the gray area) as a sequence of number that can be used to recharge the phone directly This is a sample photo only and cannot be considered as standard, thus the rectangle area may differ in position , in the background and the card also may differ in size .The scratch area may not be fully scratched , the camera's depth and position may differ too . I read a lots and lots of papers on the internet but i can't find any thing that could be interesting and most of papers discuss detection of

from_logits=True and from_logits=False get different training result for tf.losses.CategoricalCrossentropy for UNet

☆樱花仙子☆ 提交于 2019-12-05 07:46:19
I am doing the image semantic segmentation job with unet, if I set the Softmax Activation for last layer like this: ... conv9 = Conv2D(n_classes, (3,3), padding = 'same')(conv9) conv10 = (Activation('softmax'))(conv9) model = Model(inputs, conv10) return model ... and then using loss = tf.keras.losses.CategoricalCrossentropy(from_logits=False) The training will not converge even for only one training image. But if I do not set the Softmax Activation for last layer like this: ... conv9 = Conv2D(n_classes, (3,3), padding = 'same')(conv9) model = Model(inputs, conv9) return model ... and then

how to perform character segmentation in Matlab [closed]

a 夏天 提交于 2019-12-05 07:30:40
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I have license plate image and I want to cut the numbers one by one. any one have simple idea how to perform it? after searching the web I found a way by doing the operation of horizontal and vertical smearing, but I really don't know what does it mean. any explanation would help Thanks in advance. 回答1: you can

opencv floor detection by segmentation

你说的曾经没有我的故事 提交于 2019-12-05 02:38:43
问题 I'm working on a a way to detect the floor in an image. I'm trying to accomplish this by reducing the image to areas of color, and then assuming that the largest area is the floor. (We get to make some pretty extensive assumptions about the environment the robot will operate in) What I'm looking for is some recommendations on algorithms that would be suited to this problem. Any help would be greatly appreciated. Edit: specifically I am looking for an image segmentation algorithm that can

Opencv import highgui in android studio is showing error.Cannot resolve(I added the library still the error remain)

我的梦境 提交于 2019-12-05 01:09:21
I have the following code which is for image segmentation using grabcut opencv. I am using opencv for the first time. I added the opencv library. While others worked perfectly highgui is still showing cannot resolve symbol.Do i need to add something else. ( If you can help me with the code too, will be an additional help ) Here is the code: Edit : I have posted the updated code: package com.example.android.seg; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import java.io.IOException;