image-segmentation

Segment out those objects that have holes in it

会有一股神秘感。 提交于 2019-12-23 12:37:09
问题 I have a binary image, that has circles and squares in it. imA = imread('blocks1.png'); A = im2bw(imA); figure,imshow(A);title('Input Image - Blocks'); imBinInv = ~A; figure(2); imshow(imBinInv); title('Inverted Binarized Original Image'); Some circles and squares have small holes in them based on which, I have to generate an image which has only those circles and squares that have holes/missing point in them. How can I code that? PURPOSE: Later on, using regionprops in MATLAB, I will extract

Optimizing algorithm for segmentation through image substraction

核能气质少年 提交于 2019-12-23 07:56:21
问题 for a project in OpenCV I would like to segment moving objects as good as possible with of course minimal noise. For this I would like to use an image substraction algorithm. I already have a running program but didn't find a way today to get fair enough results. I already have the following (grayscale) images given: IplImage* grayScale; IplImage* lastFrame; IplImage* secondLastFrame; IplImage* thirdLastFrame; So far I have tried to substract current frames image and the last frame with cvSub

How to construct horizontal projection of binary image in OpenCV

孤街醉人 提交于 2019-12-23 04:31:04
问题 I am doing a text segmentation project for school. I need to do horizontal image projection of a binary image. The results that I want are like this: . I am using OpenCV in Python. I used x_sum = cv2.reduce(img, 0, cv2.REDUCE_SUM, dtype=cv2.CV_32S) to get the array of sums, as advised by this question: horizontal and vertical projection of an image and this question: Horizontal Histogram in OpenCV. I tried to get the horizontal projection image by using cv2.calcHist , but what I got was just

Extract numbers from Image

限于喜欢 提交于 2019-12-22 05:53:11
问题 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

Text extraction and segmentation open CV

半世苍凉 提交于 2019-12-22 01:37:04
问题 I've never used OpenCV before, but I'm trying to write my neural network system to recognize text and I need some tool for text extraction/ segmentation. How can I use java OpenCV to preprocess and segmentate an image containing text. I don't need to recognize the text, I just need to get each letter in a separate image. Something like this : 回答1: Try this code .No need of OpenCV import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List; import org.neuroph.imgrec

WindowScrollWheelFcn with slider in Matlab GUI

…衆ロ難τιáo~ 提交于 2019-12-21 21:25:47
问题 I'm making a GUI in Matlab that scrolls through and displays ~600 medical images. I have an axes on which the images are displayed, and a scrollbar that presently goes through images one at a time when the end arrows are pressed. I'm trying to figure out how to incorporate the WindowScrollWheelFcn so I can use the scroll on the mouse to go through the images faster. This is my code: function ct_slider_Callback(hObject, eventdata, handles) set(gcf, 'WindowScrollWheelFcn', @wheel); set(gcf,

Why is color segmentation easier on HSV?

☆樱花仙子☆ 提交于 2019-12-21 20:33:08
问题 I've heard that if you need to do a color segmentation on your software (create a binary image from a colored image by setting pixels to 1 if they meet certain threshold rules like R<100, G>100, 10< B < 123) it is better to first convert your image to HSV. Is this really true? And why? 回答1: The big reason is that it separates color information (chroma) from intensity or lighting (luma). Because value is separated, you can construct a histogram or thresholding rules using only saturation and

what are my research areas for image processing project?

限于喜欢 提交于 2019-12-21 19:55:08
问题 For my final year project I'm doing a vehicle detail modification system. the system should be able to these following tasks. I'm using a size image of a vehicle taken from a fixed distance lets say from 5m. and different colors and rim images are stored I'm my application, that is is the basic idea. detect the tire and the alloy rim of the vehicle detect and measure the rim size of the installed rim apply a new alloy rim to the vehicle ( embed or put the alloy rim on top of the original

How is the smooth dice loss differentiable?

∥☆過路亽.° 提交于 2019-12-21 14:06:11
问题 I am training a U-Net in keras by minimizing the dice_loss function that is popularly used for this problem: adapted from here and here def dsc(y_true, y_pred): smooth = 1. y_true_f = K.flatten(y_true) y_pred_f = K.flatten(y_pred) intersection = K.sum(y_true_f * y_pred_f) score = (2. * intersection + smooth) / (K.sum(y_true_f) + K.sum(y_pred_f) + smooth) return score def dice_loss(y_true, y_pred): return (1 - dsc(y_true, y_pred)) This implementation is different from the traditional dice loss

What is the difference between Keras model.evaluate() and model.predict()?

时间秒杀一切 提交于 2019-12-21 09:20:20
问题 I used Keras biomedical image segmentation to segment brain neurons. I used model.evaluate() it gave me Dice coefficient: 0.916. However, when I used model.predict() , then loop through the predicted images by calculating the Dice coefficient, the Dice coefficient is 0.82. Why are these two values different? 回答1: The problem lies in the fact that every metric in Keras is evaluated in a following manner: For each batch a metric value is evaluated. A current value of loss (after k batches is