2d FDM 源代码 用于均匀磁场的位场延拓
it s do FOR THE MAGNETION modeling! (2009-03-13, Fortran, 2KB, 下载34次)
判断点是否在区域内.
Private Sub Command1_Click()
当点与任一顶点重合时,返回“不在多边形区域”
Line (0, 0)-(500, 500), RGB(255, 255), BF
Dim hRegion As Long
Dim P() As PointAPI
ReDim P(9) As PointAPI
P(0).X = 10: P(0).Y = 190: PSet (P(0).X, P(0).Y), vbRed
P(1).X = 400: P(1).Y = 270: Line (P(0).X, P(0).Y)-(P(1).X, P(1).Y), vbRed
P(2).X = 220: P(2).Y = 70: Line -(P(2).X, P(2).Y), vbRed
P(3).X = 220: P(3).Y = 30: Line -(P(3).X, P(3).Y), vbRed
P(4).X = 50: P(4).Y = 30: Line -(P(4).X, P(4).Y), vbRed
P(5).X = 50: P(5).Y = 70: Line -(P(5).X, P(5).Y), vbRed
P(6).X = 30: P(6).Y = 70: Line -(P(6).X, P(6).Y), vbRed
P(7).X = 30: P(7).Y = 185: Line -(P(7).X, P(7).Y), vbRed
P(8).X = 85: P(8).Y = 85: Line -(P(8).X, P(8).Y), vbRed
P(9).X = 120: P(9).Y = 200: Line -(P(9).X, P(9).Y), vbRed
Line -(P(0).X, P(0).Y), vbRed
Determine the point in the region. Private Sub Command1_Click () when the points of coincidence with any one vertex, the return of not polygon region Line (0, 0)- (500, 500), RGB (255, 255), BF Dim hRegion As Long Dim P () As PointAPI ReDim P (9) As PointAPI P (0). X = 10: P (0). Y = 190: PSet (P (0). X, P (0). Y), vbRed P (1). X = 400: P (1). Y = 270: Line (P (0). X, P (0). Y)- (P (1). X, P (1). Y ), vbRed P (2). X = 220: P (2). Y = 70: Line- (P (2). X, P (2). Y), vbRed P (3). X = 220: P (3). Y = 30: Line- (P (3). X, P (3). Y), vbRed P (4). X = 50: P (4). Y = 30: Line- (P ( 4). X, P (4). Y), vbRed P (5). X = 50: P (5). Y = 70: Line- (P (5). X, P (5). Y), vbRed P (6). X = 30: P (6). Y = 70: Line- (P (6). X, P (6). Y), vbRed P (7). X = 30: P (7 ). Y = 185: Line- (P (7). X, P (7). Y), vbRed P (8). X = 85: P (8). Y = 85: Line- (P (8) . X, P (8). Y), vbRed P (9). X = 120: P (9). Y = 200: Line- (P (9). X, P (9). Y), vbRed Line- (P (0). X, P (0). Y), vbRed (2008-04-16, Visual Basic, 3KB, 下载24次)
计算图片中大米的个数,计算每个大米的周长和中心点
Here we are interested to find number of rices and their perimeters as well as their center of gravities.
Using the image, segment rices in a binary image. Then you can use the help mfile (Q2.m) to see how we can lable, find perimeter and calculate center of gravity for each object. (you should get 97 rices for good segmentation). (2011-09-27, matlab, 45KB, 下载14次)