Ask Your Question

Paul2208's profile - activity

2021-02-12 11:18:06 -0600 received badge  Notable Question (source)
2019-01-26 08:23:13 -0600 received badge  Popular Question (source)
2017-02-28 13:27:14 -0600 received badge  Student (source)
2016-04-19 10:30:57 -0600 received badge  Enthusiast
2016-04-16 21:15:09 -0600 commented answer Access Image pixels' value OpenCV, C++

It is exactly what I was looking for. Thanks.

2016-04-16 21:14:34 -0600 received badge  Scholar (source)
2016-04-16 21:14:29 -0600 received badge  Supporter (source)
2016-04-16 19:54:01 -0600 asked a question Access Image pixels' value OpenCV, C++

Hello all,

I am trying to access color image pixels' values an somehow process them. Here is what I am trying to do:

  1. I have two color images I1 & I2 (same size images).
  2. I would like to compare all their pixels: compare I1(i,j) with I2(i,j).
  3. if I1(i,j) > I2(i,j) , copy I1(i,j) to a new image I3(i,j)
  4. else copy I2(i,j) to I3(i,j)
  5. at the end return the color image I3

I am using opencv3.1 and visual studio 2015.

Thanks in advance.

2016-03-02 15:04:55 -0600 commented question Relative scale in monocular visual odometry

Thanks Eduardo. I will go through the paper for more understanding. Thx again.

2016-03-02 03:49:28 -0600 asked a question Relative scale in monocular visual odometry

Hello Everyone. Can anyone suggest how to obtain the scale in monocular visual odometry (ego-motion estimation)? Any document, link and/or codes are welcome.

2016-02-02 14:31:01 -0600 commented answer CLAHE for color image OpenCV 3.0

Ok, thanks berak.

2016-02-01 21:36:51 -0600 commented question CLAHE for color image OpenCV 3.0

Hi Berak. I just updated the post. Please check what I tried

2016-02-01 21:35:59 -0600 received badge  Editor (source)
2016-02-01 20:37:24 -0600 asked a question CLAHE for color image OpenCV 3.0

Hello all.

I am trying to use clahe to "adjust" (enhance the local contrast of) an colored image for further segmentation purposes. I found this code use of clahe but it only works for grayscale image (even though I change the imread function parameter to CV_LOAD_IMAGE_UNCHANGED). Can anyone suggest a code can be used for color image?

I have seen some codes splinting the color image to Lab space then merging it back to rgb Here but "split" doesn't work and I do not know what is the problem with split (since it apperently works in the last link I provided above). Any suggestion?

Here is the error I am getting when using split : Unhandled exception at 0x018EFBFE (opencv_world300.dll) in Architecture_building.exe: 0xC0000005: Access violation writing location 0x2AB9BC70

Here is what I tried (image attachedC:\fakepath\Mypic.jpg)

// read and open an image
Mat img = imread("Mypic.jpg");

if (img.empty())
{
    cout << "Error : Image cannot be loaded..." << endl;
    return -1;  
}

namedWindow("Original Image", CV_WINDOW_AUTOSIZE); //create a window with the name "Original Image"
imshow("Original Image",img); //display the image

// convert the RGB color image to Lab
Mat lab_image;
cvtColor(img, lab_image, CV_BGR2Lab);

namedWindow("Lab Image", WINDOW_AUTOSIZE);
imshow("Lab Image",lab_image);

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

namedWindow("Original Image", CV_WINDOW_AUTOSIZE);
imshow("L channel Image",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 image_clahe;
 cv::cvtColor(lab_image, image_clahe, CV_Lab2BGR);

 // display the results  
 cv::imshow("image CLAHE", image_clahe);

waitKey(0);
return 0;