Code Monkey home page Code Monkey logo

Comments (3)

ndghw avatar ndghw commented on May 22, 2024

我这个BGR转RGB时,出来的结果64位的andorid系统正常,32位的左半边是正常,右半边被填充为全0了,希望官方能帮忙看看

from flycv.

ndghw avatar ndghw commented on May 22, 2024

补充一下:是32位的包跑在64位的机器上

from flycv.

stefan252423 avatar stefan252423 commented on May 22, 2024

测试代码段 fcv::Mat dst; fcv::Mat src = fcv::imread("user.jpg"); for (int i = 0; i < 20; ++i) { unsigned char* p = (unsigned char*)src.data(); int a = p[i]; std::cout << a << " "; } std::cout << std::endl; std::cout << "**__" <<std::endl; fcv::cvt_color(src, src, fcv::ColorConvertType::CVT_PA_BGR2PA_RGB); for (int i = 0; i < 20; ++i) { unsigned char_ p = (unsigned char_)src.data(); int a = p[i]; std::cout << a << " "; }

输出结果: 65 71 48 66 72 49 66 71 50 65 70 49 64 69 48 67 72 51 70 76

65 71 48 66 72 49 66 71 50 65 70 49 64 69 48 67 72 51 70 76

这种写法正确:
fcv::Mat dst;
fcv::cvt_color(src, dst, fcv::ColorConvertType::CVT_PA_BGR2PA_RGB);
src和dst不可以是同一个Mat,必须重新定义新的Mat

from flycv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.