aardio的opencv库

Overview

opencv_aardio

dll库下载地址:https://github.com/xuncv/opencv-plugin/releases

import cv2
img = cv2.imread("./images/Lena.jpg",1)
img = cv2.medianBlur(img,5)
cv2.imshow( "窗口标题",img )
cv2.imwrite("result.jpg",img)
cv2.waitKey(0)

opencv具有500多个跨平台的图像处理函数,是目前应用最广的数字图像库。opencv历史发展过程中由C接口慢慢转向C++接口,使其他语言(python除外)调用opencv的难度增大。最近找到一个针对.NET的封装库项目OpenCvSharp ,对opencv的接口进行了重新封装,对opencv版本的跟进也很及时。

虽然这个库面向.NET,但其封装的接口对aardio异常友好。使用aardio调用dll时,甚至比.NET更简单方便。

比如Mat类作为参数时,.NET的实现是添加一个CvPtr成员,用来存储Mat指针,然后每次需取一次CvPtr作为dll接口的指针,一次api调用需要封装3次。aardio的实现就非常优雅,在mat类代码中只需修改下属性表,就可以让dll直接使用aardio的mat对象

_metaProperty = ..util.metaProperty(
		_topointer = function(){
			return owner.handle; 
		}
		...
)		

甚至不需要声明API接口,就可以直接调用API。

var imread = dll["imgcodecs_imread"];
imread(srcMat,1);

基于以上几点,我开始尝试使用aardio对opencv进行封装,接口实现上尽量接近opencv-python风格,降低学习成本。

aardio原生支持opencv,我希望能解决以下问题:

  1. 充分融合aardio的胶水特性,增强aardio图像处理能力。
  2. 结合aardio桌面优势,如制作上位机软件时可提高工程进度。
  3. 使opencv项目轻量化。(我的conda文件夹已经10+G了)。
  4. 提高opencv启动速度,在算法测试中提高效率。
  5. 实时窗体显示,便于调参。

2021年4月18日

You might also like...
Comments
  • 下载后提未错误putTextZH为NULL

    下载后提未错误putTextZH为NULL


    aardio:运行时错误

    错误行号:#4 文件:[string "import cv2..."]: 不支持此操作:call 定义类型:method(table) 名字:'putTextZH' 类型:null

    调用栈: [string "import cv2..."]:4: in main chunk

    确定

    opened by kwan3277 2
  • 提示:Cannot load library

    提示:Cannot load library

    已下载DLL放置在\lib\cv2.res,运行时提示:

    aardio:运行时错误

    文件:[string "import cv2..."] 错误行号:#1 错误:import cv2 failed :

    文件:...esktop\opencv_aardio-main\lib\cv2_.aardio 错误行号:#2 错误:Cannot load library '~/lib/cv2/.res/OpenCvSharpExtern.dll'.

    调用栈: [kernel]: in function 'import' [string "import cv2..."]:1: in main chunk

    确定

    是不是因为DLL文件下载的不对?系统win10x64

    opened by kwan3277 2
  • CV2默认库里的bitwise_or,bitwise_xor函数是否有个小BUG?

    CV2默认库里的bitwise_or,bitwise_xor函数是否有个小BUG?

    `bitwise_or = function(src1,src2,mask){ var dst = ..cv2.mat(); mask = mask ? (mask.cvPtr) var err = dll.core_bitwise_or(src1.cvPtr,src2.cvPtr.dst.cvPtr,null); //这里是否应该为:src2.cvPtr,dst.cvPtr,null return dst; }

    bitwise_xor = function(src1,src2,mask){ var dst = ..cv2.mat(); mask = mask ? (mask.cvPtr) var err = dll.core_bitwise_xor(src.cvPtr,src2.cvPtr,dst.cvPtr,null) //这里是否应该为src1.cvPtr,src2.cvPtr,dst.cvPtr,null return dst; }`

    改后调用正常,没改前总报错

    opened by zhhl99 1
  • 反馈几个问题

    反馈几个问题

    1、cv2.Mat 和 cv2.MatExpr 库 的库文件名,首字母未改为大写(mat.aardio matExpr.aardio),好像会造成传错参数后,无法弹出错误提示,直接退出的问题。 2、从 bitmap 创建 cv2.Mat 对象时,有些像素格式的图片显示不正常,我使用以下代码显示常见像素格式图片:

        //bitmap传入
        elseif(tArg == type.table && arg[["pBitmap"]]){
            var data = arg.lockMemory(,0x26200A);
            err,ret = dll.core_Mat_new8(arg.height,arg.width,0x18/*_CV_8UC4*/,data.Scan0,data.Stride,{ptr value});
            this.handle = ret.value;
            arg.unlockMemory(data);
        }
    

    3、cv2.Mat 对象 的toBitmap() 好像会造成内存泄漏(即使转换后,手动释放 cv2.Mat对象 和bitmap对象),我使用以下代码实现,暂时未发现内存大幅上涨的现象(转换后,手动释放 cv2.Mat对象 和bitmap对象)

    toBitmap = function(){
    	if(this.empty() or this.depth() != 0/*_CV_8U*/) return null;
        var pixelFormats = {
        	[1] = 0x30803;
        	[3] = 0x21808;
        	[4] = 0x26200A;
        }
        
        var pixelFormat = pixelFormats[this.channels()];
        var stride = this.step1();
        if(stride % 4 ){
        	stride = stride - (stride % 4 ) + 4;
        }
    	return ..gdip.bitmap( this.width,this.height,pixelFormat,this.data,stride );
    }
    
    opened by iycai 0
This is a GUI for scrapping PDFs with the help of optical character recognition making easier than ever to scrape PDFs.

pdf-scraper-with-ocr With this tool I am aiming to facilitate the work of those who need to scrape PDFs either by hand or using tools that doesn't imp

Jacobo José Guijarro Villalba 75 Oct 21, 2022
Resizing Canny Countour In Python

Resizing_Canny_Countour Install Visual Studio Code , https://code.visualstudio.com/download Select Python and install with terminal( pip install openc

Walter Ng 1 Nov 07, 2021
A tensorflow implementation of EAST text detector

EAST: An Efficient and Accurate Scene Text Detector Introduction This is a tensorflow re-implementation of EAST: An Efficient and Accurate Scene Text

2.9k Jan 02, 2023
This pyhton script converts a pdf to Image then using tesseract as OCR engine converts Image to Text

Script_Convertir_PDF_IMG_TXT Este script de pyhton convierte un pdf en Imagen luego utilizando tesseract como motor OCR convierte la Imagen a Texto. p

alebogado 1 Jan 27, 2022
A toolbox of scene text detection and recognition

FudanOCR This toolbox contains the implementations of the following papers: Scene Text Telescope: Text-Focused Scene Image Super-Resolution [Chen et a

FudanVIC Team 170 Dec 26, 2022
~1000 book pages + OpenCV + python = page regions identified as paragraphs, lines, images, captions, etc.

cosc428-structor I had an open-ended Computer Vision assignment to complete, and an out-of-copyright book that I wanted to turn into an ebook. Convent

Chad Oliver 45 Dec 06, 2022
A bot that extract text from images using the Tesseract OCR.

Text from image (OCR) @ocr_text_bot A simple bot to extract text from images. Usage What do I need? A AWS key configured locally, see here. NodeJS. I

Weverton Marques 4 Aug 06, 2021
CTPN + DenseNet + CTC based end-to-end Chinese OCR implemented using tensorflow and keras

简介 基于Tensorflow和Keras实现端到端的不定长中文字符检测和识别 文本检测:CTPN 文本识别:DenseNet + CTC 环境部署 sh setup.sh 注:CPU环境执行前需注释掉for gpu部分,并解开for cpu部分的注释 Demo 将测试图片放入test_images

Yang Chenguang 2.6k Dec 29, 2022
Source code of our TPAMI'21 paper Dual Encoding for Video Retrieval by Text and CVPR'19 paper Dual Encoding for Zero-Example Video Retrieval.

Dual Encoding for Video Retrieval by Text Source code of our TPAMI'21 paper Dual Encoding for Video Retrieval by Text and CVPR'19 paper Dual Encoding

81 Dec 01, 2022
This is the code for our paper DAAIN: Detection of Anomalous and AdversarialInput using Normalizing Flows

Merantix-Labs: DAAIN This is the code for our paper DAAIN: Detection of Anomalous and Adversarial Input using Normalizing Flows which can be found at

Merantix 14 Oct 12, 2022
Python bindings for JIGSAW: a Delaunay-based unstructured mesh generator.

JIGSAW: An unstructured mesh generator JIGSAW is an unstructured mesh generator and tessellation library; designed to generate high-quality triangulat

Darren Engwirda 26 Dec 13, 2022
a Deep Learning Framework for Text

DeLFT DeLFT (Deep Learning Framework for Text) is a Keras and TensorFlow framework for text processing, focusing on sequence labelling (e.g. named ent

Patrice Lopez 350 Dec 19, 2022
Memory tests solver with using OpenCV

Human Benchmark project This project is OpenCV based programs which are puzzle solvers for 7 different games for https://humanbenchmark.com/. made as

Bahadır Araz 24 Dec 27, 2022
Make OpenCV camera loops less of a chore by skipping the boilerplate and getting right to the interesting stuff

camloop Forget the boilerplate from OpenCV camera loops and get to coding the interesting stuff Table of Contents Usage Install Quickstart More advanc

Gabriel Lefundes 9 Nov 12, 2021
Line based ATR Engine based on OCRopy

OCR Engine based on OCRopy and Kraken using python3. It is designed to both be easy to use from the command line but also be modular to be integrated

948 Dec 23, 2022
This repository contains the code for the paper "SCANimate: Weakly Supervised Learning of Skinned Clothed Avatar Networks"

SCANimate: Weakly Supervised Learning of Skinned Clothed Avatar Networks (CVPR 2021 Oral) This repository contains the official PyTorch implementation

Shunsuke Saito 235 Dec 18, 2022
Source Code for AAAI 2022 paper "Graph Convolutional Networks with Dual Message Passing for Subgraph Isomorphism Counting and Matching"

Graph Convolutional Networks with Dual Message Passing for Subgraph Isomorphism Counting and Matching This repository is an official implementation of

HKUST-KnowComp 13 Sep 08, 2022
Text recognition (optical character recognition) with deep learning methods.

What Is Wrong With Scene Text Recognition Model Comparisons? Dataset and Model Analysis | paper | training and evaluation data | failure cases and cle

Clova AI Research 3.2k Jan 04, 2023
MXNet OCR implementation. Including text recognition and detection.

insightocr Text Recognition Accuracy on Chinese dataset by caffe-ocr Network LSTM 4x1 Pooling Gray Test Acc SimpleNet N Y Y 99.37% SE-ResNet34 N Y Y 9

Deep Insight 99 Nov 01, 2022
Pre-Recognize Library - library with algorithms for improving OCR quality.

PRLib - Pre-Recognition Library. The main aim of the library - prepare image for recogntion. Image processing can really help to improve recognition q

Alex 80 Dec 30, 2022