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
Detect textlines in document images

Textline Detection Detect textlines in document images Introduction This tool performs border, region and textline detection from document image data

QURATOR-SPK 70 Jun 30, 2022
Generate a list of papers with publicly available source code in the daily arxiv

2021-06-08 paper code optimal network slicing for service-oriented networks with flexible routing and guaranteed e2e latency networkslicing multi-moda

79 Jan 03, 2023
The code for “Oriented RepPoints for Aerail Object Detection”

Oriented RepPoints for Aerial Object Detection The code for the implementation of “Oriented RepPoints”, Under review. (arXiv preprint) Introduction Or

WentongLi 207 Dec 24, 2022
Introduction to Augmented Reality (AR) with Python 3 and OpenCV 4.2.

Introduction to Augmented Reality (AR) with Python 3 and OpenCV 4.2.

fernanda rodríguez 85 Jan 02, 2023
A machine learning software for extracting information from scholarly documents

GROBID GROBID documentation Visit the GROBID documentation for more detailed information. Summary GROBID (or Grobid, but not GroBid nor GroBiD) means

Patrice Lopez 1.9k Jan 08, 2023
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
Developed an AI-based system to control the mouse cursor using Python and OpenCV with the real-time camera.

Developed an AI-based system to control the mouse cursor using Python and OpenCV with the real-time camera. Fingertip location is mapped to RGB images to control the mouse cursor.

Ravi Sharma 71 Dec 20, 2022
OCR, Object Detection, Number Plate, Real Time

README.md PrePareded anaconda env requirements.txt clova AI → deep text recognition → trained weights (ex, .pth) wpod-net weights (ex, .h5 , .json) ht

Kaven Lee 7 Dec 06, 2022
Creating a virtual tv using opencv in python3.

Virtual-TV Creating a virtual tv using opencv in python3. In order to run the code follow the below given steps: Make sure the desired videos which ar

Vamsi 1 Jan 01, 2022
A simple component to display annotated text in Streamlit apps.

Annotated Text Component for Streamlit A simple component to display annotated text in Streamlit apps. For example: Installation First install Streaml

Thiago Teixeira 312 Dec 30, 2022
Visual Attention based OCR

Attention-OCR Authours: Qi Guo and Yuntian Deng Visual Attention based OCR. The model first runs a sliding CNN on the image (images are resized to hei

Yuntian Deng 1.1k Jan 02, 2023
Um simples projeto para fazer o reconhecimento do captcha usado pelo jogo bombcrypto

CaptchaSolver - LEIA ISSO 😓 Para iniciar o codigo: pip install -r requirements.txt python captcha_solver.py Se você deseja pegar ver o resultado das

Kawanderson 50 Mar 21, 2022
A Screen Translator/OCR Translator made by using Python and Tesseract, the user interface are made using Tkinter. All code written in python.

About An OCR translator tool. Made by me by utilizing Tesseract, compiled to .exe using pyinstaller. I made this program to learn more about python. I

Fauzan F A 41 Dec 30, 2022
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
1st place solution for SIIM-FISABIO-RSNA COVID-19 Detection Challenge

SIIM-COVID19-Detection Source code of the 1st place solution for SIIM-FISABIO-RSNA COVID-19 Detection Challenge. 1.INSTALLATION Ubuntu 18.04.5 LTS CUD

Nguyen Ba Dung 170 Dec 21, 2022
Document manipulation detection with python

image manipulation detection task: -- tianchi function image segmentation salie

JiaKui Hu 3 Aug 22, 2022
Hiiii this is the Spanish for Linux and win 10 and in the near future the english version of PortScan my new tool on which you can see what ports are Open only with the IP adress.

PortScanner-by-IIT PortScanner es una herramienta programada en Python3. Como su nombre indica esta herramienta escanea los primeros 150 puertos de re

5 Sep 19, 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
Detecting Text in Natural Image with Connectionist Text Proposal Network (ECCV'16)

Detecting Text in Natural Image with Connectionist Text Proposal Network The codes are used for implementing CTPN for scene text detection, described

Tian Zhi 1.3k Dec 22, 2022
Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless.

Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless. This is the official Roboflow python package that interfaces with the Roboflow API.

Roboflow 52 Dec 23, 2022