Skip to content

AliChegini1990/captcha_gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Captcha generator

A C++ library for making captcha.

Requirement

  • opencv
sudo apt install libopencv-dev 

How to use

#include "Captcha.h"
#include <iostream>
#include <vector>

int main(){ 
  std::vector<unsigned char> buf{};
  std::string cap{"empty"};
  
  int t = generateCaptcha(buf, cap);
  if (t != 0) {
    return -1;
  }
  // convert: buffer -> png
  cv::Mat m = cv::imdecode(buf, cv::IMREAD_UNCHANGED);
  cv::imwrite("test1.png", m);
}

Build

mkdir build
cd build
cmake ..
make

Test

cp libcaptcha.so test/
cd test
./test

About

Captcha generator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published