Ask Your Question

Stéphane Charette's profile - activity

2021-05-31 08:11:25 -0600 received badge  Notable Question (source)
2021-05-31 08:11:25 -0600 received badge  Popular Question (source)
2020-10-13 03:57:37 -0600 received badge  Popular Question (source)
2020-10-03 00:34:42 -0600 received badge  Editor (source)
2020-10-03 00:34:42 -0600 edited question what are the video plugins?

what are the video plugins? Installed OpenCV v4 on Ubuntu 20.04 using vcpkg: ./vcpkg install --triplet x64-linux openc

2020-10-03 00:33:54 -0600 asked a question what are the video plugins?

what are the video plugins? Installed OpenCV v4 on Ubuntu 20.04 using vcpkg: ./vcpkg install --triplet x64-linux openc

2020-08-17 12:43:27 -0600 received badge  Notable Question (source)
2020-05-21 09:51:19 -0600 received badge  Popular Question (source)
2019-11-10 19:18:02 -0600 asked a question Can OpenCV use the same GPU as the OS desktop?

Can OpenCV use the same GPU as the OS desktop? If a video card is already in use to display a desktop, does this mean it

2019-09-02 01:46:15 -0600 asked a question How to alpha blend with transparency masks

How to alpha blend with transparency masks I have figured out how to do alpha blend with transparency masks, but as with

2019-08-31 17:19:06 -0600 asked a question What does LINE_4, LINE_8 mean?

What does LINE_4, LINE_8 mean? If I zoom in on small circles drawn with the following C++ code: const int radius = 4; c

2019-08-18 02:41:55 -0600 marked best answer change all instances of a colour to a different one in C++

I would like to take all pure white pixels (255, 255, 255) from a CV_8UC3 image, and convert them to something else, say grey (128, 128, 128).

I could iterate through all the pixels, inspect each one to get the colour, etc. mat.at<uint8_t>(point) but that's not efficient.

What I did was create a new image with the colour I wanted, create a mask of the areas I want from the original image, and copy the masked area overtop of the new background colour. Looks a bit like this:

cv::Mat mask = cv::Mat::zeros(fg.size(), CV_8UC1);
mask = (mat == 0); // example: only mask the pure black pixels from the original image
cv::Mat newImage(mat.size(), CV_8UC3, cv::Scalar(128, 128, 128)); // create the new image
mat.copyTo(newImage, mask);

While this works, it is backwards and I suspect not as efficient as masking the white pixels and changing just those. I think the correct way would have been to mask the white area only, and then set that masked area to the new colour.

cv::Mat mask = cv::Mat::zeros(fg.size(), CV_8UC1);
mask = (mat == 255); // create a mask of only the white pixels
// ...but then what?

The problem is I'm not sure how to efficiently changed those masked pixels to the new colour.

2019-08-14 14:49:33 -0600 commented question change all instances of a colour to a different one in C++

Accidentally submitted twice. Delete this one.

2019-08-14 14:48:10 -0600 asked a question change all instances of a colour to a different one in C++

change all instances of a colour to a different one in C++ I would like to take all pure white pixels (255, 255, 255) fr

2019-08-14 14:47:53 -0600 asked a question change all instances of a colour to a different one in C++

change all instances of a colour to a different one in C++ I would like to take all pure white pixels (255, 255, 255) fr

2019-06-10 19:51:28 -0600 commented answer How to build OpenCV 4.1.0 on Ubuntu 18.10

That is very messed up. I hope that is a bug, and not a decision that was made. Even the most trivial OpenCV applicati

2019-05-28 16:35:27 -0600 asked a question How to build OpenCV 4.1.0 on Ubuntu 18.10

How to build OpenCV 4.1.0 on Ubuntu 18.10 Any chance someone has a tutorial newer than the nine year old instructions on

2019-05-19 11:14:57 -0600 commented answer failed to build Ubuntu .deb file for OpenCV

And where would I do that? The .deb is created with CPack.

2019-05-14 07:58:02 -0600 asked a question failed to build Ubuntu .deb file for OpenCV

failed to build Ubuntu .deb file for OpenCV I need to install OpenCV 4.1.0 on many Ubunu 18.04 computers, and would like

2018-11-07 07:12:15 -0600 received badge  Necromancer (source)
2018-11-06 13:23:01 -0600 answered a question YUYV422 to BGR

To build on Mathieu Barnachon's earlier answer, looking through opencv2/imgproc.hpp is key. When using webcams, a commo

2018-07-30 22:45:44 -0600 asked a question How are RGB images converted to greyscale?

How are RGB images converted to greyscale? Given 3 images of pure red, pure green, and pure blue, once converted to grey

2018-07-30 00:44:00 -0600 received badge  Enthusiast
2018-07-19 00:24:11 -0600 answered a question [problem]:Using OpenCV with gcc and CMake

Just out of curiosity, what type of system are you using? Because this: -- The C compiler identification is GNU 5.5.0

2018-07-19 00:01:25 -0600 answered a question How to remove unwanted areas/pixels from image ?

I wrote a few blog posts earlier this year on how to do some of this. Creating thresholds, canny edge detection, findin

2018-07-18 23:20:57 -0600 answered a question The camera is not working

Just in case you want to try a different option to see if it helps, you can try using CamCap: https://www.ccoderun.ca/p

2017-03-13 03:35:32 -0600 asked a question Recognizing some text (but not OCR) in opencv 2.4.9

Using opencv, I identify interesting contours in images, individually rotate them back to angle zero, and crop them to obtain exactly what is needed. These images are then saved to disk or inserted into a database, etc. So far, so good.

The problem is rotating them back to zero is not necessary correct. From there, I may need to rotate them another 90, 180, or 270 degrees to make sure the final saved images are right-side-up.

Each image contains English-language text. I don't need to perform OCR to "read" the text, but I was thinking that maybe I could leverage this and attempt to detect a few letters. If a few letters were correctly detected, then I'd know the image was rotated correctly. Otherwise I'd rotate another 90° and attempt again.

Can this text recognition be done in OpenCV? I see on the web that v3 has some new OCR capabilities, but on Ubuntu we're still on v2.4.9 of OpenCV.

Here is an example image I've captured, rotated to zero, and cropped, but which obviously still needs to be rotated another 90° CCW:

image description

2017-03-12 05:09:31 -0600 marked best answer How to combine multiple cv::RotatedRect objects?

I have several rotated rects obtained from cv::minAreaRect(contour). Now I want to combine some of them to create a single rotated rect that encompasses the ones that interest me.

Looking at the class reference for rotated rects, it contains not much, making me think I'm looking at the wrong docs.

Low karma wont let me post links, but these are the docs I was looking at: - http :// docs.opencv.org/trunk/db/dd6/classcv_1_1RotatedRect.html

How would I go about combining them?