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
Some codes from PyImageSearch course's and external projects.

👨‍💻 Some codes and projects 👨‍💻 💡 Technologies 📜 Projects 📍 Chrome Dinosaur Controller 📦 Script 📍 Coins Counter 📦 Script 🤓 Author Lucas Biv

Lucas Bivar 25 Oct 24, 2021
A small C++ implementation of LSTM networks, focused on OCR.

clstm CLSTM is an implementation of the LSTM recurrent neural network model in C++, using the Eigen library for numerical computations. Status and sco

Tom 794 Dec 30, 2022
Creating of virtual elements of the graphical interface using opencv and mediapipe.

Virtual GUI Creating of virtual elements of the graphical interface using opencv and mediapipe. Element GUI Output Description Button By default the b

Aleksei 4 Jun 16, 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
RepMLP: Re-parameterizing Convolutions into Fully-connected Layers for Image Recognition

RepMLP RepMLP: Re-parameterizing Convolutions into Fully-connected Layers for Image Recognition Released the code of RepMLP together with an example o

260 Jan 03, 2023
Application that instantly translates sign-language to letters.

Sign Language Translator Project Description The main purpose of project is translating sign-language to letters. In accordance with this purpose we d

3 Sep 29, 2022
⛓ marc is a small, but flexible Markov chain generator

About marc (markov chain) is a small, but flexible Markov chain generator. Usage marc is easy to use. To build a MarkovChain pass the object a sequenc

Max Humber 65 Oct 27, 2022
FOTS Pytorch Implementation

News!!! Recognition branch now is added into model. The whole project has beed optimized and refactored. ICDAR Dataset SynthText 800K Dataset detectio

Ning Lu 599 Dec 19, 2022
make a better chinese character recognition OCR than tesseract

deep ocr See README_en.md for English installation documentation. 只在ubuntu下面测试通过,需要virtualenv安装,安装路径可自行调整: git clone https://github.com/JinpengLI/deep

Jinpeng 1.5k Dec 28, 2022
Super Mario Game With Python

Super_Mario Hello all this is a simple python program which tries to use our body as a controller for the super mario game Here I have used media pipe

Adarsh Badagala 219 Nov 25, 2022
Total Text Dataset. It consists of 1555 images with more than 3 different text orientations: Horizontal, Multi-Oriented, and Curved, one of a kind.

Total-Text-Dataset (Official site) Updated on April 29, 2020 (Detection leaderboard is updated - highlighted E2E methods. Thank you shine-lcy.) Update

Chee Seng Chan 671 Dec 27, 2022
基于openpose和图像分类的手语识别项目

手语识别 0、使用到的模型 (1). openpose,作者:CMU-Perceptual-Computing-Lab https://github.com/CMU-Perceptual-Computing-Lab/openpose (2). 图像分类classification,作者:Bubbl

20 Dec 15, 2022
Computer vision applications project (Flask and OpenCV)

Computer Vision Applications Project This project is at it's initial phase. This is all about the implementation of different computer vision techniqu

Suryam Thapa 1 Jan 26, 2022
Code for the head detector (HeadHunter) proposed in our CVPR 2021 paper Tracking Pedestrian Heads in Dense Crowd.

Head Detector Code for the head detector (HeadHunter) proposed in our CVPR 2021 paper Tracking Pedestrian Heads in Dense Crowd. The head_detection mod

Ramana Subramanyam 76 Dec 06, 2022
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
A real-time dolly zoom camera effect

Dolly-Zoom I've always been amazed by the gradual perspective change of dolly zoom, and I have some experience in python and OpenCV, so I decided to c

Dylan Kai Lau 52 Dec 08, 2022
Driver Drowsiness Detection with OpenCV & Dlib

In this project, we have built a driver drowsiness detection system that will detect if the eyes of the driver are close for too long and infer if the driver is sleepy or inactive.

Mansi Mishra 4 Oct 26, 2022
A webcam-based 3x3x3 rubik's cube solver written in Python 3 and OpenCV.

Qbr Qbr, pronounced as Cuber, is a webcam-based 3x3x3 rubik's cube solver written in Python 3 and OpenCV. 🌈 Accurate color detection 🔍 Accurate 3x3x

Kim 金可明 502 Dec 29, 2022
Recognizing the text contents from a scanned visiting card

Recognizing the text contents from a scanned visiting card. The application which is used to recognize the text from scanned images,printeddocuments,r

Faizan Habib 1 Jan 28, 2022
Recognizing cropped text in natural images.

ASTER: Attentional Scene Text Recognizer with Flexible Rectification ASTER is an accurate scene text recognizer with flexible rectification mechanism.

Baoguang Shi 681 Jan 02, 2023