Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to increase the text brightness opencv c++

How to increase the text brightness of text document using opencv c++ in IOS.I am changed the text document color to white, text is display very light. Thanks in advance.

How to increase the text brightness opencv c++

This actual image:C:\fakepath\Screen Shot 2015-06-22 at 6.57.01 pm.png

This is output image: C:\fakepath\Screen Shot 2015-06-22 at 6.56.20 pm.png

How to increase the text brightness of text document using opencv c++ in IOS.I am changed the text document color to white, text is display very light. Thanks in advance.

cv::Mat lab_image; cv::cvtColor(src, lab_image, CV_BGR2Lab);

    // Extract the L channel
    std::vector<cv::Mat> lab_planes(3);
    cv::split(lab_image, lab_planes);  // now we have the L image in lab_planes[0]

    // apply the CLAHE algorithm to the L channel
    cv::Ptr<cv::CLAHE> clahe = cv::createCLAHE();
    clahe->setClipLimit(4);
    cv::Mat dst;
    clahe->apply(lab_planes[0], dst);

    // Merge the the color planes back into an Lab image
    dst.copyTo(lab_planes[0]);
    cv::merge(lab_planes, lab_image);

    // convert back to RGB
    cv::Mat imgH;
    cv::cvtColor(lab_image, imgH, CV_Lab2BGR);

How to increase the text brightness opencv c++

This actual is output image:C:\fakepath\Screen Shot 2015-06-22 at 6.57.01 pm.png

This is output actual image: C:\fakepath\Screen Shot 2015-06-22 at 6.56.20 pm.png

How to increase the text brightness of text document using opencv c++ in IOS.I am changed the text document color to white, text is display very light. Thanks in advance.

cv::Mat lab_image; cv::cvtColor(src, lab_image, CV_BGR2Lab);

    // Extract the L channel
    std::vector<cv::Mat> lab_planes(3);
    cv::split(lab_image, lab_planes);  // now we have the L image in lab_planes[0]

    // apply the CLAHE algorithm to the L channel
    cv::Ptr<cv::CLAHE> clahe = cv::createCLAHE();
    clahe->setClipLimit(4);
    cv::Mat dst;
    clahe->apply(lab_planes[0], dst);

    // Merge the the color planes back into an Lab image
    dst.copyTo(lab_planes[0]);
    cv::merge(lab_planes, lab_image);

    // convert back to RGB
    cv::Mat imgH;
    cv::cvtColor(lab_image, imgH, CV_Lab2BGR);