getCls(3)

📦 version 3.0.1.3, in ubuntu resolute, ubuntu stonking

💖 getCls(3) — the "grab the text out of an image" girlie 💖

okay bestie, listen up, this is a page from the Library Functions Manual, and it's about a little function called getCls that does exactly what it says on the tin: 获取文字内容 (it pulls the text content out, periodt). she's serving OCR realness and we're obsessed. 🎀


✨ NAME ✨

getCls — 获取文字内容


🌸 SYNOPSIS 🌸

#include <libkyocr.hpp>

💅 Classes

  • class kdk::kdkOCR

🦋 Functions

std::vector<std::string> getCls(const std::string &imagePath, int nums);

Link with -lkyocr.


👑 DETAILED DESCRIPTION 👑

The main function of the interface is to obtain text content. that's literally her whole job. main character energy, no side quests. ✨

The argument imagePath is the image file path. yes bestie, the path. to the image. 🖼️

The argument nums is the number of text stacks processed simultaneously. so like, how many text stacks she's juggling at once — multitasking queen. 🔥


💜 RETURN VALUE 💜

Returns the text string in the image of type std::vector<std::string>. so you get a whole lil vector of strings, one for each chunk of text she found. slay. 🫶


🌈 EXAMPLES 🌈

here's the vibe, copy-paste ready, no cap:

#include "libkyocr.hpp"
#include "iostream"

using namespace kdk;

int main(){

    std::string path = "./222.png";
    std::string path2 = "./sdsd.png";
    std::string path3 = "./222.jpg";
    kdkOCR kd1;
    //std::cout<<"aaaaaaaa";
    std::vector<std::string> result;
    result=kd1.getCls(path3,4);
    std::cout<<result.size()<<std::endl;
    for(int i=0; i<result.size();i++){
        std::cout<<result[i]<<std::endl;//打印容器的内容
    }
    //kd1.getText(path);
    return 0;
};

like look at her go. she declares path, path2, and path3, but only path3 actually gets used (the others are just standing there looking pretty, we love them anyway 💀), makes a kdkOCR called kd1, and then getCls(path3,4) does the thing with 4 simultaneous text stacks. then she prints result.size() and loops through every element printing result[i] — and yes the comment says //打印容器的内容 which is just "print the container's contents," thank you for the reminder queen. 🙈


⭐ CONFORMING TO ⭐

These functions are as per the withdrawn POSIX.1e draft specification. (withdrawn, bestie — so, retro. vintage. iconic in a historical way. 💅)

The following functions are Linux extensions: getRect().


🎀 SEE ALSO 🎀

getRect(3).


🌟 and that's the whole page! remember: every flag, every argument, every default, every path stays exactly where it is — the vibe is upgraded, the facts are untouched. that's the rule and we respect it. 🫶

My Project · Wed Sep 20 2023 · sending you all the love and all the text extraction, mwah 💖✨🦋

📦 where this page comes from