-
二维码识别
2018-07-19 11:13:06二维码扫描识别技术,可以开启相机并且识别生活中的二维码,使用zxing.dll+Unity -
js实现长按二维码识别及上传二维码识别
2018-11-13 15:08:29js实现长按二维码识别及上传二维码识别。样式随便写的,可以自己修改 -
Zxing二维码识别
2018-05-11 16:17:43Zxing 二维码识别 二维码识别 二维码识别 二维码识别 -
二维码识别源码
2018-10-13 15:34:57二维码识别源码 -
qt二维码识别
2019-04-11 09:11:29本例程可以实现二维码识别,条形码识别,但是没有源码,如需下载请谨慎考虑,此应用程序在win运行,可以用于对比二维码识别结果是否正确。 -
ios 二维码识别
2019-04-24 20:19:45利用opencv实现二维码识别优化,提供识别效率以及速度。 -
二维码识别API
2019-02-25 22:31:56二维码识别API 二维码识别API背景 二维码识别API技术在我们的日常生活中已经应用的非常广泛,如支付宝和微信中的扫一扫功能,应用的就是条码识别技术(二维码识别)。想必很多企业也想在自有的APP中集成这样的...二维码识别API
二维码识别API背景
二维码识别API技术在我们的日常生活中已经应用的非常广泛,如支付宝和微信中的扫一扫功能,应用的就是条码识别技术(二维码识别)。想必很多企业也想在自有的APP中集成这样的二维码识别API技术,针对这一需求,我们开发出二维码识别API,APP集成二维码识别API后,即可扫一扫识别各种条码(包含二维码、一维码)。
二维码识别API简介
二维码识别API是我们开发的一款基于android、ios平台的二维码识别API,目前支持对一维码、二维码的识别。开发包体积小,集成方便简单,可快速完成集成,集成后APP即可获取二维码识别API的功能。
二维码识别API特点:
1.快:识别速度快,单个条码识别速度小于0.1秒。
2.准:识别率高达99%
3.轻:开发包体积轻便,不到0.5M
4.全:识别条码全,可识别市面上所有的条码类型。
-
屏幕二维码识别工具
2018-04-26 17:46:56屏幕二维码识别工具,用于手动截取屏幕上的二维码 并识别二维码,本程序基于.net 4.5开发,程序包含ZXing.dll二维码识别库 -
Borgwarner二维码识别
2020-10-23 18:47:22Borgwarner二维码识别康耐视ID读码器-完整工件追踪的正确混合通过配置康耐视生产的DataMan7500、DataMan100ID读码器以及In-Sight5110视觉系统,德国的BorgWarner涡轮增压系统可以从新的方向对其涡轮增压器的生产进行... -
python 摄像头二维码识别
2019-03-05 16:43:16python 摄像头二维码识别 -
二维码识别 matlab代码 内附二维码
2019-04-16 16:01:35二维码识别,matlab代码,内附二维码,内有界面,选择输入,注意输入顺序! -
超级好用的二维码识别
2018-07-11 13:57:59识别进度超高的二维码识别结合ZXing,Zbar 给你想要的二维码识别体验 -
二维码识别库
2018-01-17 14:53:241,支持QR二维码识别. 2,支持CODE128,CODE39,I25,EAN13等四种编码方式的条码识别. 3,支持UTF8-OEM转换输出(需要客户自己提供转换码表). -
摄像头二维码识别-二维码生成.rar
2019-09-24 00:36:55qt二维码识别,qt二维码生成,qt调用可识别摄像头,本机或外设usb摄像头切换,历程版本qt5.7 Mingw编译器,100%可用 -
二维码识别系统 MATLAB
2017-11-03 16:01:33二维码识别系统 ,使用MATLAB,可以自动生成二维码以及相应的解析二维码的信息,系统成熟 -
Android二维码识别技术
2017-08-27 14:04:59二维码识别最近开发的项目中又涉及到二维码识别的技术,主要是做二维码扫码支付功能,我就从网上找了一个高逼格的可以自定义的三方库进行使用(使用的是博客一片枫叶_刘超,博客http://my.csdn.net/qq_23547831),首先看一下界面效果
首先你要引入三方库文件
compile 'cn.yipianfengye.android:zxing-library:2.2'
Java代码如下
case R.id.button3://定制化二维码扫描模式 intent = new Intent(MainActivity.this, SecondActivity.class); startActivityForResult(intent, REQUEST_CODE); break;
这里的SecondActivity就是自定义的Activity
只是比之前的CaptureActivity多了一行代码
这里的布局文件中引用了一个自定义的控件ViewFinerView,他是继承自View的CodeUtils.setFragmentArgs(captureFragment, R.layout.my_camera);
<declare-styleable name="ViewfinderView"> <attr name="inner_width" format="dimension"/> <attr name="inner_height" format="dimension"/> <attr name="inner_margintop" format="dimension" /> <attr name="inner_corner_color" format="color" /> <attr name="inner_corner_length" format="dimension" /> <attr name="inner_corner_width" format="dimension" /> <attr name="inner_scan_bitmap" format="reference" /> <attr name="inner_scan_speed" format="integer" /> <attr name="inner_scan_iscircle" format="boolean" /> </declare-styleable>
从上面的图片中你看到的所有矩形(包括上下左右的黑框和扫描的四个角的八个矩形)都是通过Canvas.drawRect(left,top,right,bottom)方法绘制的
用户可以根据自己的需求进行适当的修改颜色和文字等内容/** * 自定义组件实现,扫描功能 */ public final class ViewfinderView extends View { private static final long ANIMATION_DELAY = 100L; private static final int OPAQUE = 0xFF; private final Paint paint; private Bitmap resultBitmap; private final int maskColor; private final int resultColor; private final int resultPointColor; private Collection<ResultPoint> possibleResultPoints; private Collection<ResultPoint> lastPossibleResultPoints; // 扫描线移动的y private int scanLineTop; // 扫描线移动速度 private int SCAN_VELOCITY; // 扫描线 private Bitmap scanLight; // 是否展示小圆点 private boolean isCircle; public ViewfinderView(Context context) { this(context, null); } public ViewfinderView(Context context, AttributeSet attrs) { this(context, attrs, -1); } public ViewfinderView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); paint = new Paint(); Resources resources = getResources(); maskColor = resources.getColor(R.color.viewfinder_mask); resultColor = resources.getColor(R.color.result_view); resultPointColor = resources.getColor(R.color.possible_result_points); possibleResultPoints = new HashSet<>(5); scanLight = BitmapFactory.decodeResource(resources, R.drawable.scan_light); initInnerRect(context, attrs); } /** * 初始化内部框的大小 * * @param context * @param attrs */ private void initInnerRect(Context context, AttributeSet attrs) { TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.ViewfinderView); // 扫描框距离顶部 float innerMarginTop = ta.getDimension(R.styleable.ViewfinderView_inner_margintop, -1); if (innerMarginTop != -1) { CameraManager.FRAME_MARGINTOP = (int) innerMarginTop; } // 扫描框的宽度 CameraManager.FRAME_WIDTH = (int) ta.getDimension(R.styleable.ViewfinderView_inner_width, DisplayUtil.screenWidthPx / 2); // 扫描框的高度 CameraManager.FRAME_HEIGHT = (int) ta.getDimension(R.styleable.ViewfinderView_inner_height, DisplayUtil.screenWidthPx / 2); // 扫描框边角颜色 innercornercolor = ta.getColor(R.styleable.ViewfinderView_inner_corner_color, Color.parseColor("#45DDDD")); // 扫描框边角长度 innercornerlength = (int) ta.getDimension(R.styleable.ViewfinderView_inner_corner_length, 65); // 扫描框边角宽度 innercornerwidth = (int) ta.getDimension(R.styleable.ViewfinderView_inner_corner_width, 15); // 扫描bitmap Drawable drawable = ta.getDrawable(R.styleable.ViewfinderView_inner_scan_bitmap); if (drawable != null) { } // 扫描控件 scanLight = BitmapFactory.decodeResource(getResources(), ta.getResourceId(R.styleable.ViewfinderView_inner_scan_bitmap, R.drawable.scan_light)); // 扫描速度 SCAN_VELOCITY = ta.getInt(R.styleable.ViewfinderView_inner_scan_speed, 5); isCircle = ta.getBoolean(R.styleable.ViewfinderView_inner_scan_iscircle, true); ta.recycle(); } @Override public void onDraw(Canvas canvas) { Rect frame = CameraManager.get().getFramingRect(); if (frame == null) { return; } int width = canvas.getWidth(); int height = canvas.getHeight(); // Draw the exterior (i.e. outside the framing rect) darkened paint.setColor(resultBitmap != null ? resultColor : maskColor); canvas.drawRect(0, 0, width, frame.top, paint); canvas.drawRect(0, frame.top, frame.left, frame.bottom + 1, paint); canvas.drawRect(frame.right + 1, frame.top, width, frame.bottom + 1, paint); canvas.drawRect(0, frame.bottom + 1, width, height, paint); if (resultBitmap != null) { // Draw the opaque result bitmap over the scanning rectangle paint.setAlpha(OPAQUE); canvas.drawBitmap(resultBitmap, frame.left, frame.top, paint); } else { drawFrameBounds(canvas, frame); drawScanLight(canvas, frame); Collection<ResultPoint> currentPossible = possibleResultPoints; Collection<ResultPoint> currentLast = lastPossibleResultPoints; if (currentPossible.isEmpty()) { lastPossibleResultPoints = null; } else { possibleResultPoints = new HashSet<ResultPoint>(5); lastPossibleResultPoints = currentPossible; paint.setAlpha(OPAQUE); paint.setColor(resultPointColor); if (isCircle) { for (ResultPoint point : currentPossible) { canvas.drawCircle(frame.left + point.getX(), frame.top + point.getY(), 6.0f, paint); } } } if (currentLast != null) { paint.setAlpha(OPAQUE / 2); paint.setColor(resultPointColor); if (isCircle) { for (ResultPoint point : currentLast) { canvas.drawCircle(frame.left + point.getX(), frame.top + point.getY(), 3.0f, paint); } } } postInvalidateDelayed(ANIMATION_DELAY, frame.left, frame.top, frame.right, frame.bottom); } } // 扫描框边角颜色 private int innercornercolor; // 扫描框边角长度 private int innercornerlength; // 扫描框边角宽度 private int innercornerwidth; /** * 绘制取景框边框 * * @param canvas * @param frame */ private void drawFrameBounds(Canvas canvas, Rect frame) { /*paint.setColor(Color.WHITE); paint.setStrokeWidth(2); paint.setStyle(Paint.Style.STROKE); canvas.drawRect(frame, paint);*/ paint.setColor(innercornercolor); paint.setStyle(Paint.Style.FILL); int corWidth = innercornerwidth; int corLength = innercornerlength; // 左上角 canvas.drawRect(frame.left, frame.top, frame.left + corWidth, frame.top + corLength, paint); canvas.drawRect(frame.left, frame.top, frame.left + corLength, frame.top + corWidth, paint); // 右上角 canvas.drawRect(frame.right - corWidth, frame.top, frame.right, frame.top + corLength, paint); canvas.drawRect(frame.right - corLength, frame.top, frame.right, frame.top + corWidth, paint); // 左下角 canvas.drawRect(frame.left, frame.bottom - corLength, frame.left + corWidth, frame.bottom, paint); canvas.drawRect(frame.left, frame.bottom - corWidth, frame.left + corLength, frame.bottom, paint); // 右下角 canvas.drawRect(frame.right - corWidth, frame.bottom - corLength, frame.right, frame.bottom, paint); canvas.drawRect(frame.right - corLength, frame.bottom - corWidth, frame.right, frame.bottom, paint); } /** * 绘制移动扫描线 * * @param canvas * @param frame */ private void drawScanLight(Canvas canvas, Rect frame) { if (scanLineTop == 0) { scanLineTop = frame.top; } if (scanLineTop >= frame.bottom - 30) { scanLineTop = frame.top; } else { scanLineTop += SCAN_VELOCITY; } Rect scanRect = new Rect(frame.left, scanLineTop, frame.right, scanLineTop + 30); canvas.drawBitmap(scanLight, null, scanRect, paint); } public void drawViewfinder() { resultBitmap = null; invalidate(); } public void addPossibleResultPoint(ResultPoint point) { possibleResultPoints.add(point); } /** * 根据手机的分辨率从 dp 的单位 转成为 px(像素) */ public static int dip2px(Context context, float dpValue) { final float scale = context.getResources().getDisplayMetrics().density; return (int) (dpValue * scale + 0.5f); } }
最后附上github地址https://github.com/yipianfengye/android-zxingLibrary
-
二维码识别软件
2014-05-17 10:05:27强大的二维码识别软件,可以识别营业执照上的二维码,电脑版。 -
基于STM32的二维码识别源码+二维码解码库lib
2020-12-21 17:12:03基于STM32的二维码识别源码+二维码解码库lib -
Hololens 二维码识别
2020-04-28 01:47:33Unity+Hololens二维码识别 文章下方附带zxing.unity.dll文件和Unity项目源码 进行二维码识别之前,需要对Hololens的开发环境进行配置,以及Unity开发Hololens需要的一些设置,介绍文章很多,不多说了。 开发环境 ...Unity+Hololens二维码识别
文章下方附带zxing.unity.dll文件和Unity项目源码
进行二维码识别之前,需要对Hololens的开发环境进行配置,以及Unity开发Hololens需要的一些设置,介绍文章很多,不多说了。
开发环境
Unity 2018.4.14 (IL2CPP模式下)
Hololens 1代
VS 2019识别二维码是基于zxing.unity.dll,需要放在Plugins文件夹下,并设置为所有平台通用
上代码
using UnityEngine; using System.Collections; using ZXing; using UnityEngine.UI; using System.Threading; using System; public class QRcode : MonoBehaviour { /// <summary> 包含RGBA </summary> private Color32[] data; /// <summary> 相机捕捉到的图像 </summary> private WebCamTexture webCameraTexture; /// <summary> ZXing中的方法,可读取二维码中的内容 </summary> private BarcodeReader barcodeReader; /// <summary> 计时,0.5s扫描一次 </summary> private int timer = 500; public Text QRcodeText; public Animation scanAni; public AudioSource audio; public RawImage cameraTexture; Thread thread; public System.Collections.Concurrent.ConcurrentQueue<System.Action> _MainThreadQueue = new System.Collections.Concurrent.ConcurrentQueue<Action>(); /// <summary> /// 初始化 /// </summary> /// <returns></returns> IEnumerator Start() { barcodeReader = new BarcodeReader(); yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);//请求授权使用摄像头 if (Application.HasUserAuthorization(UserAuthorization.WebCam)) { WebCamDevice[] devices = WebCamTexture.devices;//获取摄像头设备 string devicename = devices[0].name; webCameraTexture = new WebCamTexture(devicename, 400, 300);//获取摄像头捕捉到的画面 cameraTexture.enabled = true; cameraTexture.texture = webCameraTexture; webCameraTexture.Play(); scanAni.Play(); thread = new Thread(ScanQRcode); thread.Start(); } } void Update() { while (_MainThreadQueue.Count > 0) { if (_MainThreadQueue.TryDequeue(out Action func)) { func?.Invoke(); } } } private void OnDisable() { thread.Abort(); } /// <summary> /// 子线程 /// </summary> private void ScanQRcode() { while (true) { _MainThreadQueue.Enqueue(() => { data = webCameraTexture.GetPixels32();//相机捕捉到的纹理 DecodeQR(webCameraTexture.width, webCameraTexture.height); }); Thread.Sleep(timer); } } /// <summary> /// 识别二维码并显示其中包含的文字、URL等信息 /// </summary> /// <param name="width">相机捕捉到的纹理的宽度</param> /// <param name="height">相机捕捉到的纹理的高度</param> private void DecodeQR(int width, int height) { var br = barcodeReader.Decode(data, width, height); if (br != null) { QRcodeText.text = br.Text; audio.Play(); } else { QRcodeText.text = ""; } } }
效果展示
(这是电脑上测试,Hololens 1代亲测OK)
zxing.unity.dll 提取码:881g
Unity项目源码 提取码:ju0k
-
AVFoundation 二维码识别,人脸识别
2020-11-24 20:44:21二维码识别 AVFoundation 二维码识别demo主要代码: #import "THCameraController.h" #import <AVFoundation/AVFoundation.h> @interface THCameraController ()<...二维码识别
#import "THCameraController.h" #import <AVFoundation/AVFoundation.h> @interface THCameraController ()<AVCaptureMetadataOutputObjectsDelegate> @property(strong,nonatomic)AVCaptureMetadataOutput *metadataOutput; //通过代理方法,拿到接收元数据时的通知 @end @implementation THCameraController - (NSString *)sessionPreset { //重写sessionPreset方法,可以选择最适合应用程序捕捉预设类型。 //苹果公司建议开发者使用最低合理解决方案以提高性能 return AVCaptureSessionPreset640x480; } - (BOOL)setupSessionInputs:(NSError *__autoreleasing *)error { //设置相机自动对焦,这样可以在任何距离都可以进行扫描。 BOOL success = [super setupSessionInputs:error]; if(success) { //判断是否能自动聚焦 if (self.activeCamera.autoFocusRangeRestrictionSupported) { //锁定设备 if ([self.activeCamera lockForConfiguration:error]) { //自动聚焦 /* iOS 7.0新增属性 允许使用范围约束来对功能进行定制。 因为扫描条码,距离都比较近。所以AVCaptureAutoFocusRangeRestrictionNear, 通过缩小距离,来提高识别成功率。 */ self.activeCamera.autoFocusRangeRestriction = AVCaptureAutoFocusRangeRestrictionNear; //释放排他锁 [self.activeCamera unlockForConfiguration]; } } } return YES; } - (BOOL)setupSessionOutputs:(NSError **)error { //获取输出设备 self.metadataOutput = [[AVCaptureMetadataOutput alloc]init]; //判断是否能添加输出设备 if ([self.captureSession canAddOutput:self.metadataOutput]) { //添加输出设备 [self.captureSession addOutput:self.metadataOutput]; dispatch_queue_t mainQueue = dispatch_get_main_queue(); //设置委托代理 [self.metadataOutput setMetadataObjectsDelegate:self queue:mainQueue]; //指定扫描对是OR码 & Aztec 码 (移动营销) NSArray *types = @[AVMetadataObjectTypeQRCode,AVMetadataObjectTypeAztecCode,AVMetadataObjectTypeDataMatrixCode,AVMetadataObjectTypePDF417Code]; self.metadataOutput.metadataObjectTypes = types; }else { //错误时,存储错误信息 NSDictionary *userInfo = @{NSLocalizedDescriptionKey:@"Faild to add metadata output."}; *error = [NSError errorWithDomain:THCameraErrorDomain code:THCameraErrorFailedToAddOutput userInfo:userInfo]; return NO; } return YES; } //委托代理回掉。处理条码 - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection { if (metadataObjects.count > 0) { NSLog(@"%@",metadataObjects[0]); /* <AVMetadataMachineReadableCodeObject: 0x17002db20, type="org.iso.QRCode", bounds={ 0.4,0.4 0.1x0.2 }>corners { 0.4,0.6 0.6,0.6 0.6,0.4 0.4,0.4 }, time 122373330766250, stringValue ""http://www.echargenet.com/portal/csService/html/app.html */ } //获取了 [self.codeDetectionDelegate didDetectCodes:metadataObjects]; } @end
人脸识别
#import "THCameraController.h" #import <AVFoundation/AVFoundation.h> @interface THCameraController ()<AVCaptureMetadataOutputObjectsDelegate> @property(nonatomic,strong)AVCaptureMetadataOutput *metadataOutput; @end @implementation THCameraController - (BOOL)setupSessionOutputs:(NSError **)error { self.metadataOutput = [[AVCaptureMetadataOutput alloc]init]; //为捕捉会话添加设备 if ([self.captureSession canAddOutput:self.metadataOutput]){ [self.captureSession addOutput:self.metadataOutput]; //获得人脸属性 NSArray *metadatObjectTypes = @[AVMetadataObjectTypeFace]; //设置metadataObjectTypes 指定对象输出的元数据类型。 /* 限制检查到元数据类型集合的做法是一种优化处理方法。可以减少我们实际感兴趣的对象数量 支持多种元数据。这里只保留对人脸元数据感兴趣 */ self.metadataOutput.metadataObjectTypes = metadatObjectTypes; //创建主队列: 因为人脸检测用到了硬件加速,而且许多重要的任务都在主线程中执行,所以需要为这次参数指定主队列。 dispatch_queue_t mainQueue = dispatch_get_main_queue(); //通过设置AVCaptureVideoDataOutput的代理,就能获取捕获到一帧一帧数据 [self.metadataOutput setMetadataObjectsDelegate:self queue:mainQueue]; return YES; }else { //报错 if (error) { NSDictionary *userInfo = @{NSLocalizedDescriptionKey:@"Failed to still image output"}; *error = [NSError errorWithDomain:THCameraErrorDomain code:THCameraErrorFailedToAddOutput userInfo:userInfo]; } return NO; } } //捕捉数据 - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection { //使用循环,打印人脸数据 for (AVMetadataFaceObject *face in metadataObjects) { NSLog(@"Face detected with ID:%li",(long)face.faceID); NSLog(@"Face bounds:%@",NSStringFromCGRect(face.bounds)); } //将元数据 传递给 THPreviewView.m 将元数据转换为layer [self.faceDetectionDelegate didDetectFaces:metadataObjects]; } @end