image-segmentation

word segmentation using opencv [closed]

点点圈 提交于 2019-11-27 12:33:48
问题 I am working on some scanned text images and I need to highlight all the words in that image.I know the problem is equivalent to finding subimages with extra whitespaces around them. OCR cannot be used and I just need to outline each word with a border. Can someone suggest how it might be done using OpenCV. I have tried reading about thresholding and segmenting.I am just looking for someone to point me to some relevant material. 回答1: I think your image has a multiline text. In that case,

how to remove background image and get fore image

可紊 提交于 2019-11-27 12:25:57
问题 there are two images alt text http://bbs.shoucangshidai.com/attachments/month_1001/1001211535bd7a644e95187acd.jpg alt text http://bbs.shoucangshidai.com/attachments/month_1001/10012115357cfe13c148d3d8da.jpg one is background image another one is a person's photo with the same background ,same size,what i want to do is remove the second image's background and distill the person's profile only. the common method is subtract first image from the second one,but my problem is if the color of

Cross Entropy Loss for Semantic Segmentation Keras

好久不见. 提交于 2019-11-27 11:19:34
问题 I'm pretty sure this is a silly question but I can't find it anywhere else so I'm going to ask it here. I'm doing semantic image segmentation using a cnn (unet) in keras with 7 labels. So my label for each image is (7,n_rows,n_cols) using the theano backend. So across the 7 layers for each pixel, it's one-hot encoded. In this case, is the correct error function to use categorical cross-entropy? It seems that way to me but the network seems to learn better with binary cross-entropy loss. Can

How to convert an image into character segments?

偶尔善良 提交于 2019-11-27 10:36:39
问题 Often in the process of OCR, an image file is essentially cut into segments, and each character is recgnised as a segment each. For instance, has to be transformed to something like Also, is there any algorithm for Asian languages like Telugu readily available for this purpose? If not, how is this done for English? 回答1: It can be easily done using OpenCV. Below is a sample code: import cv2 import numpy as np # Load the image img = cv2.imread('sof.png') # convert to grayscale gray = cv2

how to remove straight lines or non-curvical lines in a canny image

ぃ、小莉子 提交于 2019-11-27 09:38:25
I have a canny edge image I want to remove all line except the lines that look like a semi-circle/ellipse or a 'C'. Tried Hough Circle transforms, it detects all curves.Don't need that. A simple approach would be: Find connected components Find the minimum oriented bounding box Compute the aspect ratio of the box, and check if it's too much elongated . On your image, I marked in red almost straight lines, and in green the curved lines. You can play with the threshold on the aspect ratio: Code: #include<opencv2/opencv.hpp> using namespace cv; int main() { // Load image Mat1b img = imread("path

Algorithm to detect corners of paper sheet in photo

心不动则不痛 提交于 2019-11-27 08:56:33
问题 What is the best way to detect the corners of an invoice/receipt/sheet-of-paper in a photo? This is to be used for subsequent perspective correction, before OCR. My current approach has been: RGB > Gray > Canny Edge Detection with thresholding > Dilate(1) > Remove small objects(6) > clear boarder objects > pick larges blog based on Convex Area. > [corner detection - Not implemented] I can't help but think there must be a more robust 'intelligent'/statistical approach to handle this type of

Segmentation problem for tomato leaf images in PlantVillage Dataset

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 07:16:37
问题 I am trying to do segmentation of leaf images of tomato crops. I want to convert images like following image to following image with black background I have reference this code from Github but it does not do well on this problem, It does something like this Can anyone suggest me a way to do it ? 回答1: The image is separable using the HSV-colorspace. The background has little saturation, so thresholding the saturation removes the gray. Result: Code: import numpy as np import cv2 # load image

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 extract the borders of an image (OCT/retinal scan image)

青春壹個敷衍的年華 提交于 2019-11-27 06:25:13
问题 I have an (OCT) image like shown below (original). As you can see, it mainly has 2 layers. I want to produce an image (shown in the 3rd picture), in which the red line indicates the top border of 1st layer, the green shows the brightest part of the 2nd layer. I have tried to simply thresholded the image. Then I can find the edges like shown in the 2nd image. But how can produce the red/green lines from these borders? PS: I am using matlab (or OpenCV). But any ideas with any languages/psudo

Image Segmentation using Mean Shift explained

本小妞迷上赌 提交于 2019-11-27 05:46:37
Could anyone please help me understand how Mean Shift segmentation actually works? Here is a 8x8 matrix that I just made up 103 103 103 103 103 103 106 104 103 147 147 153 147 156 153 104 107 153 153 153 153 153 153 107 103 153 147 96 98 153 153 104 107 156 153 97 96 147 153 107 103 153 153 147 156 153 153 101 103 156 153 147 147 153 153 104 103 103 107 104 103 106 103 107 Using the matrix above is it possible to explain how Mean Shift segmentation would separate the 3 different levels of numbers? The basics first: The Mean Shift segmentation is a local homogenization technique that is very