I am new to openCV and searching from past two weeks but all the answers are either in python or not that accurate. I am just looking to find maximum count of a colour in any image. I have tried converting to HSV plane and then by looping over image and extracting hue channel and then by increasing count of each colour which lies in the range. but this method was not accurate at all. So looking for a better solution.
I want to find dominant colour in an Image in Opencv C++
670 Views Asked by Amit Kumar At
1
There are 1 best solutions below
Related Questions in C++11
- lvalue and rvalue references
- c++ range-for loop over custom class ::begin() expects 1 argument, 0 provided
- Difference between INT_MIN , INT8_MIN , INT16_MIN. For MAX too
- I am getting segmentation failt while assigning the resourcemanager instance
- Prevent reordering of prefetch instruction in c++
- How to Use libcurl to Check HTTP/S Proxy?
- Why we use `class` when there's `struct` in C++?
- Memory Management in C++: Differences in allocating shared_ptr using new vs make_shared
- Does C++ range-based `for` make copies?
- Is the behaviour is determined when initliasing the inner class's static member variable's value equal to the outer class's static member variable?
- Question about initialization. The output must be zeros with C++11 and afterwards?
- How to replace non-standard "for each" received from Visual C++ users
- G ++ can not pass the parameters in using the C ++ 11 process library under Windows?
- Why the Variadic Constructor with std::is_constructible Fails to Handle Initializer List Initialization?
- Class Object Error 'Undefined Reference For'
Related Questions in COLORS
- Wrong matches between colors and values when defining colorFactor
- I want write code to predict CIE XYZ from LED driver R,G,B output value
- Finding a specific colour within a bitmap range - VB.net 2022
- In Flutter, is there a way to determine the user's skin color settings for their emojis?
- HDR video publishing
- make selected text visible in PGAdmin 4 Query Editor
- How to change x-axis group labels of my boxplot in R
- flutter stripe_android:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.tasks > Android resource linking failed
- I would like a table where cells are colored (defined by values)
- Color Thresholding JS, Average Image Color Detect JS
- Assign visually distinct colors to graphs with undirected edges
- Change text color inside offcanvas navbar
- To set Different Colors For each line in Line Chart Using NPOI excel nuget package in .Net6 Core
- Is there a way to affect the interpolation between translucent colours in WPF?
- How to change the color of an icon when hovered over
Related Questions in OPENCV3.1
- mp4 codec in Raspberry Pi 4: not writing frames to video
- How to return an image in fastAPI
- OpenCV faceDetecter yaml model loading error
- Handwritten Text Morphing of Grayscale Image
- What is difference between (CountNonZero) and (Moment M00) and (ContourArea) in OpenCV?
- There some bright white or black parts on the edges of result face for seamlessClone
- Save Videos OpenCV(python) - save several videos
- Getting correct rotations and translations from homography
- Asynchronous list of Videos to be stream using opencv in python
- How to detect width of object in picture
- Calculate Pitch and Roll and YAW by 4 points detected from a square in Opencv
- Error found "This release is not compliant with the Google Play 64-bit requirement(Opencv lib)"
- How to make OpenCV Capture Window display over my Browser Window?
- I want to find dominant colour in an Image in Opencv C++
- Opencv 3.1.0 with python 3.7
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
By looking at the color conversion from RGB to HSV, I think you can do the following:
Black:
Vis below25andSis below100White:
Vis above230andSis below30Red:
Hbelow15or above165Yellow:
Hbetween15-45Green:
Hbetween45-75Cyan:
Hbetween75-105Blue:
Hbetween105-135Magenta:
Hbetween135-165You can add more colors by narrowing down the
Hchannel, or by specifying shades to colors, i.e. if45 < H < 75, dark green forV < 128, and light green for128 < V. You need to treat black and white differently in any case. TheseSandVvalues are only examples, you can even have functions for them. Other colors are checked after the shades of gray.