image-segmentation

How to convert a Label matrix to colour matrix for image segmentation?

独自空忆成欢 提交于 2020-01-02 19:20:11
问题 I have a label matrix of 256*256 for example. And the classes are 0-11 so 12 classes. I want to convert the label matrix to colour matrix. I tried do it in a code like this `for i in range(256): for j in range(256): if x[i][j] == 11: dummy[i][j] = [255,255,255] if x[i][j] == 1: dummy[i][j] = [144,0,0] if x[i][j] == 2: dummy[i][j] = [0,255,0] if x[i][j] == 3: dummy[i][j] = [0,0,255] if x[i][j] == 4: dummy[i][j] = [144,255,0] if x[i][j] == 5: dummy[i][j] = [144,0,255] if x[i][j] == 6: dummy[i]

Extract Image Segmentation Map from Tensorflow DeepLab v3 Demo

放肆的年华 提交于 2020-01-02 19:11:11
问题 I have set up the Google's DeepLab V3 Demo on my local system and it runs successfully after making some minor changes. It's as: # -*- coding: utf-8 -*- # DeepLab Demo # This demo will demostrate the steps to run deeplab semantic segmentation model on sample input images. import os from io import BytesIO import tarfile import tempfile from six.moves import urllib from matplotlib import gridspec from matplotlib import pyplot as plt import numpy as np from PIL import Image import tensorflow as

Image processing (segmentation) in matlab

可紊 提交于 2020-01-02 00:31:06
问题 How can I detect optic cup and disc from retinal image using matlab ? I want to find out the measurement of optic rim ( distance between optic cup and optic disc ) I have tried the following code RGB = imread('img/A(4).jpg'); G = DialateBloodVessel(RGB); [BW,H] = RGBThresh(G,220,60); H = H(:,:,3); I = edge(H,'Roberts',0.1); imshowpair(I,G); %%%%%%%%%% DialateBloodVessel( RGB ) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [ RemovedBV ] = DialateBloodVessel( RGB ) %UNTITLED3 Summary of this

Accurately detect color regions in an image using K-means clustering

試著忘記壹切 提交于 2020-01-01 17:01:28
问题 I'm using K-means clustering in color-based image segmentation. I have a 2D image which has 3 colors, black, white, and green. Here is the image, I want K-means to produce 3 clusters, one represents the green color region, the second one represents the white region, and the last one represents the black region. Here is the code I used, %Clustering color regions in an image. %Step 1: read the image using imread, and show it using imshow. img = (imread('img.jpg')); figure, imshow(img), title('X

Vehicle segmentation and tracking

匆匆过客 提交于 2020-01-01 06:08:48
问题 I've been working on a project for some time, to detect and track (moving) vehicles in video captured from UAV's, currently I am using an SVM trained on bag-of-feature representations of local features extracted from vehicle and background images. I am then using a sliding window detection approach to try and localise vehicles in the images, which I would then like to track. The problem is that this approach is far to slow and my detector isn't as reliable as I would like so I'm getting quite

How to calculate nucleus amount of cell?

五迷三道 提交于 2020-01-01 03:01:32
问题 I am using Python 3.5 and OpenCV 3 to analyze pictures of cells in biology. My pictures look like this: I want to be able to calculate a ratio of the area of the cell's nucleus to the area of the cell as a whole. In my slides, the nucleus is dark purple and other regions of the cell are light blue. There are also tan coloured red blood cells which I want to ignore entirely. For clarity, here's a labeled image: How can I use image segmentation to identify and measure my regions of interest? I

object (Car) Detection and segmentation

血红的双手。 提交于 2019-12-30 03:33:30
问题 I am trying to segment cars from image that consist of only one car and an easy background like but what I get from my implementation is this and respectively but it works very easily on almost already segmented images like. giving results like The Code I am using is import cv2 import numpy as np THRESH_TYPE=cv2.THRESH_BINARY_INV def show(name,obj): cv2.imshow(name,obj) cv2.moveWindow(name, 100, 100) cv2.waitKey(0) cv2.destroyAllWindows() def process_end(new): drawing = np.zeros(o.shape,np

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

二次信任 提交于 2019-12-30 00:38:50
问题 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. 回答1: 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

Data Augmentation Image Data Generator Keras Semantic Segmentation

天涯浪子 提交于 2019-12-29 03:04:53
问题 I'm fitting full convolutional network on some image data for semantic segmentation using Keras. However, I'm having some problems overfitting. I don't have that much data and I want to do data augmentation. However, as I want to do pixel-wise classification, I need any augmentations like flips, rotations, and shifts to apply to both feature images and the label images. Ideally I'd like to use the Keras ImageDataGenerator for on-the-fly transformations. However, as far as I can tell, you

How to use OpenCV to remove non text areas from a business card? [closed]

ぃ、小莉子 提交于 2019-12-28 12:50:14
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . my target is to remove any non text area from a scanned business card image but i don't know the steps to perform that using OpenCV , i have followed this steps but don't know this is the right one or not also i