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
A list of hyperspectral image super-solution resources collected by Junjun Jiang

A list of hyperspectral image super-resolution resources collected by Junjun Jiang. If you find that important resources are not included, please feel free to contact me.

Junjun Jiang 301 Jan 05, 2023
Handwritten Number Recognition using CNN and Character Segmentation

Handwritten-Number-Recognition-With-Image-Segmentation Info About this repository This Repository is aimed at reading handwritten images of numbers an

Sparsha Saha 17 Aug 25, 2022
deployment of a hybrid model for automatic weapon detection/ anomaly detection for surveillance applications

Automatic Weapon Detection Deployment of a hybrid model for automatic weapon detection/ anomaly detection for surveillance applications. Loved the pro

Janhavi 4 Mar 04, 2022
Python library to extract tabular data from images and scanned PDFs

Overview ExtractTable - API to extract tabular data from images and scanned PDFs The motivation is to make it easy for developers to extract tabular d

Org. Account 165 Dec 31, 2022
Introduction to image processing, most used and popular functions of OpenCV

👀 OpenCV 101 Introduction to image processing, most used and popular functions of OpenCV go here.

Vusal Ismayilov 3 Jul 02, 2022
An Optical Character Recognition system using Pytesseract/Extracting data from Blood Pressure Reports.

Optical_Character_Recognition An Optical Character Recognition system using Pytesseract/Extracting data from Blood Pressure Reports. As an IOT/Compute

Ramsis Hammadi 1 Feb 12, 2022
Learn computer graphics by writing GPU shaders!

This repo contains a selection of projects designed to help you learn the basics of computer graphics. We'll be writing shaders to render interactive two-dimensional and three-dimensional scenes.

Eric Zhang 1.9k Jan 02, 2023
Official code for "Bridging Video-text Retrieval with Multiple Choice Questions", CVPR 2022 (Oral).

Bridging Video-text Retrieval with Multiple Choice Questions, CVPR 2022 (Oral) Paper | Project Page | Pre-trained Model | CLIP-Initialized Pre-trained

Applied Research Center (ARC), Tencent PCG 99 Jan 06, 2023
Detect the mathematical formula from the given picture and the same formula is extracted and converted into the latex code

Mathematical formulae extractor The goal of this project is to create a learning based system that takes an image of a math formula and returns corres

6 May 22, 2022
This project proposes a camera vision based cursor control system, using hand moment captured from a webcam through a landmarks of hand by using Mideapipe module

This project proposes a camera vision based cursor control system, using hand moment captured from a webcam through a landmarks of hand by using Mideapipe module

Chandru 2 Feb 20, 2022
An unofficial implementation of the paper "AutoVC: Zero-Shot Voice Style Transfer with Only Autoencoder Loss".

AutoVC: Zero-Shot Voice Style Transfer with Only Autoencoder Loss This is an unofficial implementation of AutoVC based on the official one. The reposi

Chien-yu Huang 27 Jun 16, 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 little but useful tool to explore OCR data extracted with `pytesseract` and `opencv`

Screenshot OCR Tool Extracting data from screen time screenshots in iOS and Android. We are exploring 3 options: Simple OCR with no text position usin

Gabriele Marini 1 Dec 07, 2021
([email protected]) Boosting Co-teaching with Compression Regularization for Label Noise

Nested-Co-teaching ([email protected]) Pytorch implementation of paper "Boosting Co-tea

YINGYI CHEN 41 Jan 03, 2023
Text Detection from images using OpenCV

EAST Detector for Text Detection OpenCV’s EAST(Efficient and Accurate Scene Text Detection ) text detector is a deep learning model, based on a novel

Abhishek Singh 88 Oct 20, 2022
EAST for ICPR MTWI 2018 Challenge II (Text detection of network images)

EAST_ICPR2018: EAST for ICPR MTWI 2018 Challenge II (Text detection of network images) Introduction This is a repository forked from argman/EAST for t

QichaoWu 49 Dec 24, 2022
A curated list of awesome synthetic data for text location and recognition

awesome-SynthText A curated list of awesome synthetic data for text location and recognition and OCR datasets. Text location SynthText SynthText_Chine

Tianzhong 283 Jan 05, 2023
Face_mosaic - Mosaic blur processing is applied to multiple faces appearing in the video

動機 face_recognitionを使用して得られる顔座標は長方形であり、この座標をそのまま用いてぼかし処理を行った場合得られる画像は醜い。 それに対してモ

Yoshitsugu Kesamaru 6 Feb 03, 2022
PyTorch Re-Implementation of EAST: An Efficient and Accurate Scene Text Detector

Description This is a PyTorch Re-Implementation of EAST: An Efficient and Accurate Scene Text Detector. Only RBOX part is implemented. Using dice loss

365 Dec 20, 2022
Awesome Spectral Indices in Python.

Awesome Spectral Indices in Python: Numpy | Pandas | GeoPandas | Xarray | Earth Engine | Planetary Computer | Dask GitHub: https://github.com/davemlz/

David Montero Loaiza 98 Jan 02, 2023