当前位置: 首页 > wzjs >正文

网站链接 动态图怎么做免费pc网站建设

网站链接 动态图怎么做,免费pc网站建设,企业网站程序制作,查看wordpress作者名首先我们要明白码的识别思路 把窗口全部关闭读取新的图片图像预处理创建条码模型设置模型参数搜索模型获取条码结果显示条码结果 图像预处理和条码增强 对比度太低: scale_image(或使用外部程序scale_image_range),增强图像的对比度图像模糊…

首先我们要明白码的识别思路

  • 把窗口全部关闭
  • 读取新的图片
  • 图像预处理
  • 创建条码模型
  • 设置模型参数
  • 搜索模型
  • 获取条码结果
  • 显示条码结果

图像预处理和条码增强

  1. 对比度太低: scale_image(或使用外部程序scale_image_range),增强图像的对比度
  2. 图像模糊:emphasize锐化图像,使条码看起来清晰
  3. 深背景上读取浅色条码:invert_image 反转图像 

 基本算子:

create_bar_code_model  创建条码模型

create_bar_code_model(GenParamNames,GenParamValues,BarCodeHandle)

  • GenParamNames:参数名
  • GenParamValues:参数值
  • BarCodeHandle:条码句柄

 set_bar_code_param  设置条码参数

set_bar_code_param(BarCodeHandle,GenParamName,GenParamValue)

  • BarCodeHandle:条码句柄
  • GenParamNames:参数名
  • GenParamValue:条码参数
'element_size_min'条码的最小尺寸,指条码宽度和间距,大码应设大一点,减少处理时间
'element_size_max'条码的最大尺寸,不能过小,也不能过大
'check_char'是否验证校验位,'absent'不检查校验和'present'检查校验
'persistence'设置位1,则保留中间结果,评估条码印刷质量时会用到
'num_scanlines'解码时所用扫码线的最大数目,设置为0表示自动确定,一般设置为2~30
'start_stop_tolerance'容许误差值,可设置为'low'或者'high',设置为'high'可能造成误判
'orientation'、'orientation_tol'分别指条码的方向和方向容差,设置准确可大大提高解码效率
'elemnet_height_min'条码的最小高度,默认设置-1白哦是子哦对那个推测条码高度,该参数对速度影响大
'stop_after_result_num'设置要解码的个数,0表示全部找出,设置为2表示找到2个就不找了

 find_bar_code 查找条码

find_bar_code(Image,SymbolRegions,BarCodeHandle,CodeType,DecodedDataStrings)

  • Image:输入图像
  • SymbolRegions:检测到的条形码区域
  • BarCodeHandle:条形码区域
  • CodeType:条形码类型
  • DecodedDataStrings:识别结果

get_bar_code_result  显示条码结果

 get_bar_code_result(BarCodeHandle,CandidateHandle,ResultName,BarCodeResults)

  • BarCodeHandle:条码模型处理(条码句柄)
  • CandidateHandle:候选句柄
  • ResultName:结果名
  • BarCodeResults:条形码的结果

 一维码示例

1.检测单个条形码

dev_close_window ()
dev_update_off ()
dev_set_draw ('margin')
dev_set_line_width (3)
read_image (Image, 'F:/Halcon/‫Image/1一维码barcor/barcode_1.bmp')
* 创建条码模型
create_bar_code_model ([], [], BarCodeHandle)
* 设置条码参数
set_bar_code_param (BarCodeHandle, 'barcode_width_min', 280)
set_bar_code_param (BarCodeHandle, 'barcode_height_min', 80)
* 检测读取一维码
find_bar_code (Image, SymbolRegions, BarCodeHandle, 'auto', DecodedDataStrings)
* 获取条码结果
get_bar_code_result (BarCodeHandle, 'all', 'decoded_types', BarCodeResults)
*显示
dev_get_window (WindowHandle)
msg:=BarCodeResults+'条码编号'+DecodedDataStrings
area_center (SymbolRegions, Area, Row, Column)
dev_display (Image)
dev_display (SymbolRegions)
disp_message (WindowHandle, msg, 'image', Row, Column, 'black', 'true')

 


2.检测多个条形码

dev_update_off ()
dev_close_window ()
dev_get_window (WindowHandle)
query_font (WindowHandle, Font)
tuple_find (Font, '楷体', Indices)
if(Indices!=-1)set_display_font (WindowHandle, 16, '楷体', 'true', 'false')
elseset_display_font (WindowHandle, 16, 'mono', 'true', 'false')
endif
dev_set_draw ('margin')
dev_set_line_width (3)
dev_set_color ('green')
create_bar_code_model ([], [], BarCodeHandle)
minWidth:=280
minHeight:=60
set_bar_code_param (BarCodeHandle, 'barcode_height_min', minHeight)
set_bar_code_param (BarCodeHandle, 'barcode_width_min', minWidth)
list_files ('F:/Halcon/‫Image/1一维码barcor', 'files', Files)
tuple_regexp_select (Files, '.bmp', Selection)
num:=|Selection|-1
for i:=0 to num by 1read_image (Image,Selection[i])find_bar_code (Image, SymbolRegions, BarCodeHandle, 'auto', DecodedDataStrings)get_bar_code_result (BarCodeHandle, 'all', 'decoded_types', BarCodeResults)dev_display (Image)dev_display (SymbolRegions)msg:=BarCodeHandle+'\\='+DecodedDataStringsdisp_message (WindowHandle, msg, BarCodeResults, 12, 12, 'black', 'true')stop ()
endfor

 3.检测多个,和检测不到的

dev_update_off ()
dev_close_window ()
dev_get_window (WindowHandle)
query_font (WindowHandle, Font)
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
dev_set_draw ('margin')
dev_set_color ('green')
dev_set_line_width (3)
create_bar_code_model ([], [], BarCodeHandle)
gen_empty_obj (EmptyObject)
list_files ('F:/Halcon/‫Image/2一维码', 'files', Files)
tuple_regexp_select (Files, '.bmp', Selection)
num:=|Selection|-1
for i:=0 to num by 1read_image (Image, Selection[i])find_bar_code (Image, SymbolRegions, BarCodeHandle, 'auto', DecodedDataStrings)test_equal_obj (EmptyObject, SymbolRegions, IsEqual)if(IsEqual!=0)disp_message (WindowHandle, '没有识别到一维码', 'image', 12, 12, 'black', 'true')endifget_bar_code_result (BarCodeHandle, 'all', 'decoded_types', BarCodeResults)dev_display (Image)dev_display (EmptyObject)mesg:=BarCodeResults+'\\='+DecodedDataStringsdisp_message (WindowHandle, mesg, 'image', 12, 12, 'black', 'true')stop ()
endfor

4. 查询多个不同种类

create_bar_code_model (['stop_after_result_num'], [1], BarCodeHandle)
dev_clear_window ()
dev_update_off ()
dev_get_window (WindowHandle)
query_font (WindowHandle, Font)
set_display_font (WindowHandle, 16, Font[0], 'true', 'false')
dev_set_draw ('margin')
dev_set_color ('green')
dev_set_line_width (3)
list_files ('F:/Halcon/‫Image/N维码/Ean13 一维码读取/ean13', 'files', Files)
tuple_regexp_select (Files, '(ean13)[0-9]{1,7}\\.(png)', Selection)
count:=|Selection|-1
for i:=0 to count by 1read_image (Image, Selection[i])find_bar_code (Image, SymbolRegions, BarCodeHandle, 'auto', DecodedDataStrings)get_bar_code_result (BarCodeHandle, 'all', 'decoded_types', BarCodeResults)dev_display (Image)dev_display (SymbolRegions)msg:=BarCodeResults+'\\'+DecodedDataStringsarea_center (SymbolRegions, Area, Row, Column)disp_message (WindowHandle, msg, 'image', Row, Column, 'black', 'true')if(i<count)disp_continue_message (WindowHandle, 'black', 'true')endifstop ()
endfor
dev_disp_text ('已经是最后一张了', 'window', 'bottom', 'right', 'red', [], [])
clear_bar_code_model (BarCodeHandle)

5.旋转查询

方法1: 

read_image (Image, 'barcode/ean13/ean1305')
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
dev_display (Image)
dev_set_color ('green')
dev_set_draw ('margin')
dev_set_line_width (3)
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
create_bar_code_model ('element_size_min', 1.5, BarCodeHandle)
for i:=0 to 360 by 30* 旋转图像rotate_image (Image, ImageRotate, i, 'constant')dev_display (ImageRotate)get_image_size (ImageRotate, Width, Height)*改变当前激活窗口的大小和位置dev_set_window_extents (0, 0, Width, Height)find_bar_code (ImageRotate, SymbolRegions, BarCodeHandle, 'EAN-13', DecodedDataStrings)get_bar_code_result (BarCodeHandle, 'all', 'orientation', Orientation)area_center (SymbolRegions, Area, Row, Col)* 创建一个十字箭头的轮廓gen_arrow_contour_xld (Arrow, Row + sin(rad(Orientation)) * 70, Col - cos(rad(Orientation)) * 70, Row - sin(rad(Orientation)) * 70, Col + cos(rad(Orientation)) * 70, 25, 25)dev_display (ImageRotate)dev_display (SymbolRegions)dev_set_color ('green')dev_display (Arrow)disp_message (WindowHandle, DecodedDataStrings, 'window', 12, 12, 'black', 'true')stop ()
endfor
clear_bar_code_model (BarCodeHandle)

方法2:

 

**** 主要内容:如何获取图像与平行线的夹角
**** 基于夹角 生成带有方向的箭头
dev_update_off ()
read_image (Image, 'barcode/ean13/ean1305')
dev_set_draw ('margin')
dev_set_color ('green')
dev_set_line_width (3)create_bar_code_model (['element_size_min'], [1.5], BarCodeHandle)
for rot :=0 to 360 by 30find_bar_code (Image, SymbolRegions, BarCodeHandle, 'auto', DecodedDataStrings)get_bar_code_result (BarCodeHandle, 'all', 'orientation', angle)area_center (SymbolRegions, Area, cehnterRow, centerCol)gen_arrow_contour_xld (Arrow1, cehnterRow, centerCol, cehnterRow, centerCol, 10, 1)* 难题:怎么基于 区域的中线点,与 图像与水平面的弧度,求xld的起点和终点* 以区域中心坐标为基准点,该点是,箭头上的点* 以为该点位置,将箭头分为2个部分:假设第一部分,长度为100 第二部长度为80* 已:匹配模板与水平面的夹角  rad(angle)* 求:起点 行列坐标 与 终点行列坐标 、 下面就是计算公式。startRow:= cehnterRow +sin(rad(angle)) * 100 startCol := centerCol - cos(rad(angle)) * 100 endRow := cehnterRow - sin(rad(angle)) * 80endCol := centerCol + cos(rad(angle)) * 80gen_arrow_contour_xld (Arrow, startRow, startCol, endRow, endCol, 20, 20)* 显示结果dev_display (Image)dev_display (SymbolRegions)dev_display (Arrow)rotate_image (Image, Image, rot, 'constant')stop()endfor


文章转载自:

http://H2mWJeJN.rbsmm.cn
http://eMOZBuys.rbsmm.cn
http://3pSS0sqt.rbsmm.cn
http://Ar8R8P3W.rbsmm.cn
http://23es8sSv.rbsmm.cn
http://WGS630to.rbsmm.cn
http://hv0B35lR.rbsmm.cn
http://HQvrhmuB.rbsmm.cn
http://j2XjPvca.rbsmm.cn
http://3OyzxNy4.rbsmm.cn
http://hx3IldtV.rbsmm.cn
http://MKIPi0KW.rbsmm.cn
http://OgIQWeLa.rbsmm.cn
http://061yahcr.rbsmm.cn
http://2QRi5qir.rbsmm.cn
http://nlk8hnfq.rbsmm.cn
http://BmkuARAK.rbsmm.cn
http://LReTrc1P.rbsmm.cn
http://LgDLHlwW.rbsmm.cn
http://irnJiMgj.rbsmm.cn
http://22hQSryk.rbsmm.cn
http://qv5WFGY9.rbsmm.cn
http://U5f5QnZ1.rbsmm.cn
http://4DsBktjv.rbsmm.cn
http://in668fqC.rbsmm.cn
http://xJ1hnhel.rbsmm.cn
http://Eg21TvSZ.rbsmm.cn
http://DfAGLceA.rbsmm.cn
http://dp76EnaB.rbsmm.cn
http://Z3o2kfnm.rbsmm.cn
http://www.dtcms.com/wzjs/772161.html

相关文章:

  • 西安企业黄页网站猪八戒小程序开发报价
  • 网站建设 招聘阿里巴巴可以做网站吗
  • 电子商务网站建设与管理项目计划书手机网站怎么导入微信朋友圈
  • 做有搜索功能的网站北京视频直播网站建设
  • 免费网站素材下载齐齐哈尔建设局网站首页
  • 明星个人网站设计模板网站怎么做第三方登录
  • 柬埔寨网站开发58直聘招聘网
  • 网站开发php 图片上传失败wordpress视频无法播放视频播放
  • 做彩票网站是违法的吗开发平台的公司
  • 中型企业网站建设网站没备案怎么做淘宝客
  • 青岛网站制作价格免费网站制作成品
  • 旅游攻略网站做群头像的网站在线制作
  • 免费软件app网站下载大全在线正能量网站地址链接免费
  • 滁州网站建设费用杭州网站建设培训
  • 江苏省建设厅官网网站ppt模板下载免费完整版简约
  • 4网站建设哪里好点顺德网站设计制作
  • 阿里云服务器ip做网站PHP网站建设选择哪家好
  • 宁夏做网站公司电子商务网站建设的可行性分析包括
  • apmserv访问本地网站运动网站建设
  • 网站上的超链接怎么做网页版qq登录入口空间
  • 东阳做网站的公司wordpress 表格样式
  • 外包网络推广公司推广网站推广下载app
  • 学校网站建设框架ps如何做音乐网站
  • 温州整站推广咨询网站群建设 效果
  • 丽江建设信息网站企业网站租服务器
  • 怎么建立局域网网站做网站的技术关键
  • 海外网站太慢全球跨境电商平台排名
  • js获取网站域名网页链接生成器
  • 辽阳好的网站建设公司上海南桥网站建设
  • 网站开发开票交税做网站需要考虑什么