trackbar | Yet another time-tracker application | REST library
kandi X-RAY | trackbar Summary
kandi X-RAY | trackbar Summary
Simple project to check out the Touch Bar API turned into one more screen time-tracker app with minimum functionality.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of trackbar
trackbar Key Features
trackbar Examples and Code Snippets
Community Discussions
Trending Discussions on trackbar
QUESTION
I wrote a program that used trackbars, to find out the appropriate HSV values (range) for segmenting out the white lines from the image.
For a long time this seemed like the best shot:
But its still not very accurate, its leaving out chunks of the line...
After messing around some more, I realised something:
This is very accurate: apart from the fact that the black and white regions are swapped.
Is there any way to invert this colour scheme to swap the black and white regions? If not, what exactly can I do to not leave out chunks of the line like the first image...I have tried out various HSV combinations and it seems like this is the closest I can get.
code:
...ANSWER
Answered 2021-May-24 at 06:33To invert the mask
QUESTION
The problem I have it is:
I tried to download 1000+ images -> it works, but it takes a very long time to load the image downloaded completely, and the program continues and downloads the next image etc... Until let's admit 100 but the 8th image is still not finished downloading.
So I would like to understand why I encounter such a problem here and / or how to fix this problem.
Hope to see an issue
...ANSWER
Answered 2021-May-18 at 17:48So I would like to understand why I encounter such a problem here and / or how to fix this problem.
There are probably two reasons I can think of.
- Connection/Port Exhaustion
- Thread Pool Exhaustion
Connection/Port Exhaustion
This happens when you're attempting to create too many connections at once, or when the connections you made previously have not yet been released. When you use a WebClient
the resources it uses sometimes don't get released immediately. This causes a delay between when that object is disposed and the actual time that the next WebClient
attempting to use the same port/connection actually gets access to that port.
An example of something that would most likely cause Connection/Port Exhaustion
QUESTION
I am making a basic lunar lander program in visual basic using windows forms. I have a track bar to adjust thrust. I am also using WASD to control the landers direction. WASD works fine if I haven't used the track bar to adjust the thrust. But the moment I adjust the thrust the trackbar becomes selected and I cannot use the WASD keys anymore. What do I need to do to fix this issue?picture of program
...ANSWER
Answered 2021-May-07 at 08:11To expand on Ahmed's comment, if you set KeyPreview to true then the form will experience the key events before any selected control on the form does.
QUESTION
I would like to detect this gate below, ideally the entire gate. I have played around for hours with a trackbar script but I am just not finding the right color space. I found other threads that just track yellow and not even that is working.. This is my code:
...ANSWER
Answered 2021-Apr-20 at 02:14This seems to work for me by thresholding in LAB colorspace in Python/OpenCV. According to Wikipedia at https://en.wikipedia.org/wiki/CIELAB_color_space "The a* axis is relative to the green–red opponent colors, with negative values toward green and positive values toward red." So we ought to get reasonably good separation for your green and reddish colors.
Input:
QUESTION
I'm trying to make a sorting program with Windows Forms. The goal is to allow the user to create an array by taking a value from a trackBar that determines the size of the array. For example, if the trackbar value is set to 100, then the user would press the "Create Array" button, which would then generate an integer array with 100 numbers that are random and then display them on a Chart.
Then, the user would press another button to actually sort the array. However, because the array is defined in the scope of the button that actually creates the array, I don't know how to get it into the scope of the button that sorts it. After it is sorted, I want to keep the array sorted, so it needs to be changed on a global level.
I tried to define the variable on a class level within the Form1: Form
class and have each control return a value, which would update the value for the array, but that doesn't work because my project doesn't have a static void Main()
function, and I'm not sure how to implement that into Windows Forms with my current minimal knowledge of the program.
Code example is below:
...ANSWER
Answered 2021-Mar-01 at 20:09It sounds like you want the user to be able to do operations (sort) on the last array that was created. The last array represents a piece of state held by the form.
To make a form stateful, add a member variable at the form level. In this case you'd add an array and update it whenever you create an array.
QUESTION
Context:
We are building a robot that will be assigned a color of puck to pick up and will need to go grab it. So for that, from the world view camera, he will get the approximate coordinates.
I first used HoughCircles to find the centers of each circles, but then i realized that i would also need to know the colors of corresponding circles found, so i tried an other approach ( see below).
Note: circles will be placed randomly, no no hardcoding.
Here's whats the image looks like :
Problem:
Very hard to get accurate HSV value to correctly detect the colors in the title, plus the image quality is not the best. I think the middle circle in those pucks is to help us distinguish them but as most have a light blue circle in it, im not sure how it helps haha.
What i tried:
1.
I used openCV trackbar, to get the approximate lower and upper bound for each color ( except those mentioned) which are really hard to get).
2.
I apply the mask on the picture and then find the center of circles with moments.
...ANSWER
Answered 2021-Feb-20 at 04:41This is a possible way to do it, it still uses the HSV
color space, you have to get the HSV
range values right. Look up the RGB -> HSV
equivalent values for your target colors. You could definitely benefit from some pre-processing to clean up a little bit better your masks. You can also implement a contour filter, because the blobs of interest you are looking for (the pucks) have very distinct properties, for example, aspect ratio, area and, of course, circularity. I propose the following steps:
- Get
HSV
values for each target puck you are looking for - Define the
upper
andlower
range values - Threshold the
HSV
image to get a binary mask - Apply an area filter to get rid of small noise
- Apply some morphology (
Dilate+Erode
) to improve your target blobs - Get outer contours (ignore inner contours)
- Convert these contours to
bounding rectangles
- Get two
bounding rectangles
properties:aspect ratio
andarea
- Filter your bounding rectangle according to threshold properties values
Let's see the code:
QUESTION
I am pretty new to OpenCV and am trying to achieve drawing simple contours along the outline of my hand using a webcam. I decided on using cv2.adaptiveThreshold()
to deal with the different light intensities when the camera adjusts to the hand moving. Everything seems to work fine except that it is struggling with finding the fingers and then also drawing closed contours.
See here:
I thought about trying to detect a convex hull and detect anything deviating from it somehow.
How do I go about this best? Firstly I need to manage to maybe not find weird closed contours and then go from there?
Here's the code, I fixed the trackbar values for you :)
...ANSWER
Answered 2021-Feb-01 at 22:35I'm using a light threshold so this might work differently depending on the image, but here's what works for this one.
QUESTION
I am still new to OpenCV(Python) and am trying out cv2.adaptiveThreshold()
to draw proper contours with a webcam running when lighting is changing. The main problem is the insane amount of noise I am getting when drawing contours so I tried to set a cv2.countourArea()
threshold but this seems not like the best solution.
Later on I deciced to try and manipulate the values of cv2.adaptiveThreshold
with a simple trackbar.
Specifically the blockSize
and CValue
. Everything works fine on the CValue but I do really struggle on the blockSize
since it needs to be an odd number. I tried something along the line of checking if the value of the empty
callback function is even and adding +1. But this does not seem to work properly. Later on I will most likely use machine-learning to change these values but for now I'd like the trackbars to work for debugging purposes.
What is the best solution here to manipulate the blockSize
with a trackbar?
Thank you in advance! :)
...ANSWER
Answered 2021-Jan-27 at 21:35The minimum value of blocksize must be 3 and also blocksize must be odd therefore:
QUESTION
I am trying to save the image modified by the trackbar. When I try to save it (using imwrite
), it only saves the image before it has been modified by the trackbar. Not shown in the following code, but I have tried using imwrite
in the foo
function which did not work. I also tried returning the image and the getTrackbarPos
from the foo
function, but both values were the unmodified inputs.
ANSWER
Answered 2021-Jan-27 at 13:49Simply add an infinite loop at the end of your script recording key presses. For example, when pressing s, save the current dst
image. You'll need another key as an indicator to quit the loop, for example use q. The dst
image from your foo
method then needs to be global to be accessible by the later infinite loop.
Here's some code:
QUESTION
ANSWER
Answered 2021-Jan-14 at 00:45When you click on controls, the click event is eaten by them and doesn't go to the form itself. To notify the form that one of its controls was clicked, use something like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install trackbar
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page