contour

Ambiguous cases in Marching square algorithm

梦想与她 提交于 2020-08-08 07:09:12
问题 If we take Wikipedia article on Marching square into account, we see that case#5 and case#10 are said to be ambiguous cases. I have implemented Marching Square as follows and I am not understanding how an ambiguous case can arise: public class LinesRectangle { public Graphics Graphics { get; set; } public Color Color { get; set; } public Pen Pen { get; set; } public int Thickness { get; set; } public LinesRectangle() { Color = Color.Blue; Thickness = 2; Pen = new Pen(Color, Thickness); }

Halcon中关于角度计算和测量拟合的算子详解

安稳与你 提交于 2020-08-05 00:57:03
角度计算算子简介 1、计算直线与水平轴之间的夹角 angle_lx( : : Row1, Column1, Row2, Column2 : Angle) 角度计算方式:将直线看作向量(有方向性),以直线与水平轴的交点为起点(旋转中心)。如果终点在水平轴上方,则夹角为逆时针旋转水平轴到向量的角度(带正号)。如果终点在水平轴下方,则夹角为顺时针旋转水平轴到向量的角度(带负号)。结果取决于定义线条的两点的顺序。 角度表示方式:弧度,-π<=Angle<π 2、计算两条直线之间的夹角 angle_ll( : : RowA1, ColumnA1, RowA2, ColumnA2, RowB1, ColumnB1, RowB2, ColumnB2 : Angle) 角度计算方式:该算子计算原理与angle_lx类似,只不过把水平轴替换为任意直线B 角度表示方式:弧度,-π<=Angle<=π 3、计算一条直线的方向 line_orientation( : : RowBegin, ColBegin, RowEnd, ColEnd : Phi) 角度计算方式:当直线(无方向性)大致位于1、3象限的方向,角度为正。当直线大致位于2、4象限的方向,角度为负。 角度表示方式:弧度,-π/2<Phi<=π/2 4、计算一条直线的参数 line_position( : : RowBegin,

Curve-GCN:图卷积网络用于活动轮廓演变

﹥>﹥吖頭↗ 提交于 2020-07-29 02:28:55
CNN做分割需要处理数据量很大的grid数据,需要对所有点的label进行预测,而且传统CNN并不会结合点与点之间的联系。 使用图结构建模分割轮廓或分割曲面,然后采用GCN,仿照传统的deformable model的方法对曲线或曲面进行迭代演变实现分割 ,是一种可行的方案。如何将曲线、曲面和它的演变过程,建模到GCN框架中?本文提到的论文提供了一种实现思路。 本文直接相关的应用场景虽然不涉及医学图像分割,但是其思想,比如3D组织的分割和组织编辑,都可以借助该文章的思路。deformation model的方法在医学图像分割领域应用是非常广泛的,本文本质就是deformation model和GCN的结合。 论文:Fast Interactive e Object Annotation with Curve-GCN 网址: https://arxiv.org/pdf/1903.06874.pdf ​ arxiv.org github: https://github.com/fidler-lab/curve-gcn ​ github.com 摘要 本文提出的新框架,通过使用图卷积网络(GCN)同时预测边界上每个顶点的演变方向。 端到端训练框架和模型; 通过该方法,可实现:画一个多边形,快速完成物体的轮廓标注。 Curve-GCN比现有的方法性能都要好,包括PSP-DeepLab

【深度学习】使用CNN进行车牌识别并搭建简单GUI

流过昼夜 提交于 2020-07-27 00:33:11
主要参考博客: https://blog.csdn.net/GK_2014/article/details/84779166 主体算法没有修改,这里添加了通过H(色调)和S(饱和度)来对车牌颜色进行判断,然后使用tkinter搭建了简单的GUI,可以实现打开摄像头拍摄照片然后再对照片进行识别。 界面如下: carPlateIdentity.py 代码如下,添加了一些注释: 1 import cv2 2 import os 3 import sys 4 import numpy as np 5 import tensorflow as tf 6 7 config = tf.ConfigProto(gpu_options=tf.GPUOptions(allow_growth= True)) 8 sess = tf.Session(config= config) 9 10 char_table = [ ' 0 ' , ' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , ' 9 ' , ' A ' , ' B ' , ' C ' , ' D ' , ' E ' , ' F ' , ' G ' , ' H ' , ' I ' , ' J ' , ' K ' , 11 ' L ' , ' M ' , ' N ' , '

How do i separate overlapping cards from each other using python opencv?

醉酒当歌 提交于 2020-07-20 07:19:28
问题 I am trying to detect playing cards and transform them to get a bird's eye view of the card using python opencv. My code works fine for simple cases but I didn't stop at the simple cases and want to try out more complex ones. I'm having problems finding correct contours for cards.Here's an attached image where I am trying to detect cards and draw contours: My Code: path1 = "F:\\ComputerVisionPrograms\\images\\cards4.jpeg" g = cv2.imread(path1,0) img = cv2.imread(path1) edge = cv2.Canny(g,50

I want to sort the words extracted from image in order of their occurence using contours detection

五迷三道 提交于 2020-06-27 06:21:15
问题 I am making an OCR, I am using contours detection, I have extracted words and drawn bounding boxes but the problem is that when I crop the individual word, they are not in sorted order. I have tried sorting methods mentioned in this link to sort the contours but they work best on objects but in my case i want to make the order exact. sometimes the sorting is not the best solution it changes pattern of words as different words have different size of bounding boxes in same line and values of 'x

I want to sort the words extracted from image in order of their occurence using contours detection

早过忘川 提交于 2020-06-27 06:20:36
问题 I am making an OCR, I am using contours detection, I have extracted words and drawn bounding boxes but the problem is that when I crop the individual word, they are not in sorted order. I have tried sorting methods mentioned in this link to sort the contours but they work best on objects but in my case i want to make the order exact. sometimes the sorting is not the best solution it changes pattern of words as different words have different size of bounding boxes in same line and values of 'x

Overlapping shapes recognition (OpenCV)

瘦欲@ 提交于 2020-05-27 08:50:09
问题 I have a simple image containing some shapes: some rectangles and some ellipses, in total number of 4 or 5. The shapes can be rotated, scaled and overlapped. There is a sample input: My task is to detect all of these figures and prepare some information about them: size, position, rotation, etc. In my opinion, the core problem is the fact that the shapes can be overlapped by each other. I tried to search some information about this kind of problem and find that OpenCV library can be very

Overlapping shapes recognition (OpenCV)

会有一股神秘感。 提交于 2020-05-27 08:49:30
问题 I have a simple image containing some shapes: some rectangles and some ellipses, in total number of 4 or 5. The shapes can be rotated, scaled and overlapped. There is a sample input: My task is to detect all of these figures and prepare some information about them: size, position, rotation, etc. In my opinion, the core problem is the fact that the shapes can be overlapped by each other. I tried to search some information about this kind of problem and find that OpenCV library can be very

get mask from contour with OpenCV

痞子三分冷 提交于 2020-05-15 02:07:16
问题 I would like to get an image mask from the contour (it exists only 1 contour) I have computed thanks to cv.findContours. However, while my contour variable is not empty, I do not manage to retrieve an image mask using cv.drawContours, my destination image being always empty. Here is my code: img = mosaicImage[:,:,0].astype('uint8') contours, _ = cv.findContours(img.copy(), cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE) mask = np.zeros(img.shape, np.uint8) cv.drawContours(mask, contours, -1, (0,255,0)