Skip to main content

Posts

Showing posts with the label merge matrix

OpenCV : Make sharpen image color

We sometimes take pictures where there is no light, so the pictures come out dark. This means it did not have a wide range of colors. For example, an image with a minimum value of 20 and a maximum value of 100 will be dark. So we need to wide the color range of the image 0 to 255. The full code is as follows. #include <iostream> #include <opencv2/opencv.hpp> using namespace cv ; using namespace std ; void meanVal ( Mat * inputArray ){ double minVal , maxVal ; minMaxIdx( * inputArray , & minVal , & maxVal ); //get min, max value of matrix double ratio = ( maxVal - minVal ) / 255 ; * inputArray = ( * inputArray - minVal ) / ratio ; // wide image range cout << minVal << "," << maxVal << endl; } int main () { Mat img = imread( "./res/woman.png" ); imshow( "origin" , img ); vector < Mat > bgr_img ; split( img , bgr_img ); // split matrix to 3...