企业门户网站用户类型,长春新建高铁站,写代码建商城网站时间,网站建设功能seo文章目录 算子complement 返回一个区域的补集select_region_point 选择包含指定像素的所有区域intensity 计算灰度值的均值和偏差 案例 算子
complement 返回一个区域的补集
complement(Region : RegionComplement : : )Region (输入对象)#xff1a;这指的是输入的一个或多… 文章目录 算子complement 返回一个区域的补集select_region_point 选择包含指定像素的所有区域intensity 计算灰度值的均值和偏差 案例 算子
complement 返回一个区域的补集
complement(Region : RegionComplement : : )Region (输入对象)这指的是输入的一个或多个图像区域。这些区域通常是通过图像处理技术如阈值处理、边缘检测等从原图中提取出来的。RegionComplement (输出对象)这是指输入区域的补集区域。如果输入的“Region”是图像的一部分那么“RegionComplement”就是除了这部分以外的图像其他部分。 select_region_point 选择包含指定像素的所有区域
select_region_point(Regions : DestRegions : Row, Column : )Regions (输入对象)待检查的区域数组。这些区域是图像处理过程中识别出的一系列区域。DestRegions (输出对象)包含测试像素的所有区域数组。输出将是那些包含了由 Row 和 Column 参数指定位置的像素的所有区域。Row (输入控制)测试像素所在的行索引。这是一个整数类型的参数默认值为 100。它指定了像素在图像中的垂直位置。Column (输入控制)测试像素所在的列索引。这也是一个整数类型的参数默认值为 100。它指定了像素在图像中的水平位置。intensity 计算灰度值的均值和偏差
intensity(Regions, Image : : : Mean, Deviation)Regions (输入对象)在此区域内计算特征。这些区域是从图像中分割出来的一部分或多部分通常是感兴趣区域ROI, Regions Of Interest。Image (输入对象)单通道图像通常是指灰度图像。它可以是多种类型的单通道图像包括但不限于字节类型 (byte)、方向类型 (direction)、循环类型 (cyclic)、整型 (int1, int2, uint2, int4) 或浮点型 (real)。Mean (输出控制)一个区域的平均灰度值。如果输入的 Regions 是一个数组则 Mean 也会是一个数组其中每个元素对应于输入区域数组中的一个区域的平均灰度值。Deviation (输出控制)区域内灰度值的标准偏差。与 Mean 类似如果输入的 Regions 是多个区域则 Deviation 也会是一个数组其中每个元素对应于输入区域数组中的一个区域的灰度值标准偏差。案例 * particle.hdev: Measurement of small particles
*
dev_update_off ()
dev_close_window ()
dev_open_window (0, 0, 512, 512, black, WindowID)
set_display_font (WindowID, 14, mono, true, false)
read_image (Image, particle)
dev_display (Image)
dev_disp_text (Original image, window, 12, 12, black, [], [])
dev_disp_text (Press Run (F5) to continue, window, bottom, right, black, [], [])
stop ()
* 阈值处理
threshold (Image, Large, 110, 255)
* Dilate regions with a circular structuring element
* 膨胀
dilation_circle (Large, LargeDilation, 7.5)
dev_display (Image)
dev_set_draw (margin)
dev_set_line_width (3)
dev_set_color (red)
dev_display (LargeDilation)
dev_set_draw (fill)
dev_disp_text (Exclude large areas from processing, window, 12, 12, black, [], [])
dev_disp_text (Press Run (F5) to continue, window, bottom, right, black, [], [])
stop ()
* Continue to calculate small regions
* Return the complement of a region
*获取补集
complement (LargeDilation, NotLarge)
*将原图-补集
reduce_domain (Image, NotLarge, ParticlesRed)
* 去除杂志
mean_image (ParticlesRed, Mean, 31, 31)
* Segment the image using a local threshold
*获取亮点阈值
dyn_threshold (ParticlesRed, Mean, SmallRaw, 3, light)
* 亮点进行开运算
opening_circle (SmallRaw, Small, 2.5)
* 连接亮点
connection (Small, SmallConnection)
dev_display (Image)
dev_set_colored (12)
dev_display (SmallConnection)
dev_disp_text (Extracted small particles, window, 12, 12, black, [], [])
dev_disp_text (Press Run (F5) to continue, window, bottom, right, black, [], [])
stop ()
* Continue to select several regions and to get information
dev_set_color (green)
dev_display (Image)
dev_set_draw (margin)
dev_display (SmallConnection)
Button : 1
* Define limits for the displayed message at the end of the while-loop.
MaxRow : 450
MaxColumn : 440
MinRow : 40
MinColumn : 100
while (Button 1)dev_disp_text ([Select object with left mouse button,Right button to quit], window, 12, 12, black, box_color, #fce9d4dd)dev_set_color (green)* 点击区域点get_mbutton (WindowID, Row, Column, Button)dev_display (Image)dev_display (SmallConnection)dev_set_color (red)* 获取到选中的区域select_region_point (SmallConnection, SmallSingle, Row, Column)dev_display (SmallSingle)count_obj (SmallSingle, NumSingle)if (NumSingle 1)* 计算平均灰度值和偏差intensity (SmallSingle, Image, MeanGray, DeviationGray)*获取区域面积大小area_center (SmallSingle, Area, Row, Column)* Limit the message so that it is displayed entirely inside the graphics window.if (Row MaxRow)Row : MaxRowendifif (Column MaxColumn)Column : MaxColumnendifif (Row MinRow)Row : MinRowendifif (Column MinColumn)Column : MinColumnendifdev_disp_text ([Area Area,Intensity MeanGray$.3], image, Row 10, Column - 90, black, box_color, #fce9d4dd)endif
endwhile
dev_set_line_width (1)
dev_update_on ()