getRect(3)

📦 version 3.0.1.3, in ubuntu resolute, ubuntu stonking

💖 getRect(3) — the libkyocr glow-up 💖

okay bestie, listen up, we're in the Library Functions Manual section and this page is all about getRect(3) from the libkyocr crew. it's giving "i just want the text box coordinates" and honestly? iconic. 🎀


✨ NAME ✨

getRect — 获取文字框 (aka: go get that text box, bestie 🫶)


🌸 SYNOPSIS 🌸

#include <libkyocr.hpp>

💅 Classes

  • class kdk::kdkOCR — the main character of this whole saga 👑

🦋 Functions

std::vector<std::vector<std::vector<int>>> getRect(const std::string
    &imagePath);

Link with -lkyocr.

fr fr, do not forget the -lkyocr when you link or the vibes will NOT be immaculate 😭

🌈 Detailed Description 🌈

so the main function of the interface here is to obtain the text box. that's it. that's the whole job. get the box, get the text. slay. ✨

the argument imagePath is the image file path. yes literally just the path to your image. no cap. 🍓


⭐ RETURN VALUE ⭐

it returns the coordinate matrix of the text box points AND the number of text boxes, all as type std::vector<std::vector<std::vector<int>>>.

that's a triple-nested vector, bestie. a vector of vectors of vectors of int. it's giving "matryoshka doll but make it geometry". the way that it's three deep… lowkey obsessed. 💜


🎀 EXAMPLES 🎀

here's a whole little program, copied exactly because we do NOT play with code:

#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;
};

(not me noticing the example is out here calling getCls — yes bestie, keep it exactly as it is, we don't edit the sacred text 🙈)


🧚 CONFORMING TO 🧚

these functions are as per the withdrawn POSIX.1e draft specification. withdrawn, bestie. it's a vintage. it's archival. it's retro. 🕰️

the following functions are Linux extensions: getCls().


👑 SEE ALSO 👑


mwah 💋 that's the whole page. My Project, dated Wed Sep 20 2023 — so this page has been serving looks since 2023 and it still eats. go get those text boxes, bestie, you got this 💖✨🎀🦋🌸💅🫶

📦 where this page comes from