-
-
Notifications
You must be signed in to change notification settings - Fork 25
How should i use the calcHist method #257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
does this help
|
Yes , i was able to extract the pixel density thanks it was really helpfull @abdelaziz-mahdy . Can you please help me out on one more thing? Im trying to detect for example any object in shades of say red , im using method cv.Mat hsv = cv.imdecode(bytes,cv.COLOR_BGR2HSV); but im not sure in cv.Scalar are we putting rgb , bgr or hsv , because from the example videos of python the value which they used are not working , even when i tried the usinf rgb , brg or hsv im not getting the expected result. Can you please clarify this? |
Sorry I don't have the knowledge in the first question to answer you But for createTrackbar it exists on highgui module and it should be implemented but it's not there so @rainyl do you know why it's not implemented in the dart side? |
Sorry for the late reply, I was on vacation recently. @KartikGavhale As abdelaziz-mahdy suggested, you can always find an example in our tests at https://github.com/rainyl/opencv_dart/tree/main/test And the code you attached above is incorrect // Here, the flags of `imdecode` is same as `imread`, so you can't use the conversion flags like
// `cv.COLOR_BGR2HSV`, read more at https://docs.opencv.org/4.10.0/d4/da8/group__imgcodecs.html#gaad518fe65098fd32446bd5b9c4f8b531
cv.Mat hsv = cv.imdecode(bytes,cv.COLOR_BGR2HSV);
cv.Mat mask1=cv.inRangebyScalar(mat, cv.Scalar(0, 100, 100), cv.Scalar(10, 255, 255)); // lower range
cv.Mat mask2=cv.inRangebyScalar(mat, cv.Scalar(160, 100, 100), cv.Scalar(179, 255, 255)); // upper range
AFAIK, the order of
This project was started from gocv, so same as gocv, Maybe we can implement these methods in the future: https://docs.opencv.org/4.10.0/d7/dfc/group__highgui.html#gaf78d2155d30b728fc413803745b67a9b |
@rainyl Thanks you for the clarification and suggetions. |
If you have no more questions, I am going to close this issue, feel free to reopen it if needed. |
How should i use the calcHist method?
I tried the Described/suggested things to run this method but each step im getting error. Do you have some referance how can i do the color histogram.If possible need seperate histogram for each color i.e b r g.
The text was updated successfully, but these errors were encountered: