My goal is to implement a method, that tracks persons in a single camera. For that, I'm using Scaled Yolov4 to detect persons in the scene, then I generate points inside of their bounding boxes using cv2.goodFeaturesToTrack, and track them using Lucas-Kanade Optical Flow cv2.calcOpticalFlowPyrLK.
the problem is, sometimes the points make huge jumps, and I can't tell why. The following video shows the problem I'm facing, specifically, on second 0:02, the green dots jumps in a weird manner which makes my method detects that person as a new person.
https://www.veed.io/view/37f98715-40c5-4c07-aa97-8c2242d7806c?sharingWidget=true
my question is, is it a limitation on LK optical flow, or I'm doing something wrong? And is there a recommended Optical Flow method for tracking, or an example implementation for Single Camera Multi Person Tracking using Optical Flow? because I couldn't find much literature or codes about it.
I just want to know that how does a computer know that the value rgb(255, 0, 0) is red or how does it know that a particular color code is for a particular color?
What I want to say is that how computer know that
red means red,
green means green,
white means white,
blue means blue so on.
Please explain it without taking an analogy. I want to know the real thing happening behind the hood.
Your computer doesn't need to "know" anything about what a color "means", it just has to pass the numeric values of the R, G, and B components of a color value to your monitor, which is wired up to emit corresponding levels of red, green, and blue light. (That's oversimplifying a bit, because all sorts of color processing might go on first, but that's still the gist of it.)
Different levels of those different colors, when mixed together, produce the wide gamut of colors that your monitor can produce, and from there, it's a matter of how your brain processes that mix of primary colors that determines what colors you see.
The computer doesn't know the meaning of red (nor the meaning of the letter A).
Computer get the data (255, 0, 0) and it put it in memory, telling that pixel X has such values. Really graphic libraries handle the position of the pixel, knowing the coordinates, and also knowing the colour deep, now often we have 32-bits per pixels, with a consistent pattern.
Video card will read the memory, interpret it and convert to a standardized signal (e.g. HDMI, SRGB, 8bit per channel, progressive, 4:4:4 colour configuration, screen-size AxB, data speed, etc.), and it will send it to the screen. If screen can interpret such data flow, it will send it to the pannel, and pannel will illuminate the pixel (often it will just allow the backlight to pass thru it, with a specific intensity). A colour filter is applied over every pixel so you get (your eyes) a specific colour. If you displace the colour filter, there is no way computer, video card, screen, and panel will know about you are seeing different colours).
So: computer handle just numbers. Libraries and computer languages handle the interface user (or better programmer) to data, so that you can write "red" in CSS, or #FF0000 in HTML, or 255,0,0. Then one ore more libraries (e.g. moving windows, transparency) will handle data, having some information about structure (system setting for your screen). Video cards, screens, and pannels will know very few about the meaning of data.
Note: operating systems, video cards, and screens may change the meaning of the colours. It is usually done in colour profiles, to get better colours according hardware, but there are also test ICC files which just invert colours (or used for high contrast, or colour blind people). In such case computer have no idea that "red" will be displayed as "black" (as an example).
You should always think as "sandwich": semantic (so real meaning) should be known only on first input and last output. For the rest, computers is just working with numbers (and they may not know anything about semantic). Sorry for the unwanted analogy.
I'm trying to draw UML state diagram for vending machine, maybe its basic but im a beginner and havent found the appropriate solution on internet
Task: - the vending machine receives 1,2 and 5 $, the price of drink is 2 $
- it dispenses the drink if enough money is entered and refunds change
- machine has power on and power off)
I marked each state and transitions the numbers (STATES = s1,2 ..., TRANSITIONS = p1,2 ...), to make it easier to answer without drawing
(e.g. "p1 is wrong, there should be written this" etc)
Here is my diagram:
Questions:
Does it eventually return to IDLE - which seems to me more logical -
or it must go to the final state (rounded black point) as power off?
Or can there be two final states, so the S5 goes to another final state?
should it be after P3 or P4 maybe two branches?
maybe a new branch where the exact price amount is inserted (so there is no need for refund )
if so, where to put it?
If I understand the principle, on the arrows there should be written in this form - correct?
trigger event
[condition if it exists] /
action
Is there any basic errors I made?
Thanks in advance, I appreciate any feedback.
You can have as many finals as you need.
I'd make Dispensing an optional state after Waiting (for the > case) while the = case will directly go to selection. Just from a logical perspective. Of course you can make machines do dispense and change in parallel. In that case you need to fork to Dispense and Refund.
Correct
You should model Power off as Signal which can be triggered at any time. The power can be disconnected at any time during the machine is running, not just when it's idle.
I have a house with three floors plus a finished basement. There are three A/C units and two furnaces. The thermostat units are placed in locations chosen by the installer that are not the rooms we use most. Moving the thermostats would be very expensive.
I have abundant embedded computing power in the house (4 servers are on permanently) and the house currently has two Nest Protect devices. My plan is to install a Nest Protect in each of the rooms we want to have temperature monitored and then work out some way to control the furnace so that the temperature in the rooms being used is being controlled.
This will obviously require the UI functions of the NEST to be decoupled from the control functions in some way. One option would be to drop an Arduino into the system and have that do the actual control but that seems unnecessary when the thermostat is already capable.
I took a look at the Nest documentation but it seems to be based on a model where all the intelligence is happening in the Google cloud. That isn't a model that I am going to tolerate. I don't see the need to connect up to a Google server to mediate communications between devices in my own house. And I didn't see anything about the control functions.
It doesn't look like the Protect provides temperature data. That's unfortunate as if it did you could indeed make this work.
One method would be to place the Protects into groups that correspond to your heating / cooling zones. Whenever a Protect in one of your groups moves out of your target temperature range you could raise or lower the target temperature of the Nest that controls that zone to some extreme, just to get the heating / cooling cycle to turn on. As soon as all of the Protects in the group are back in the target zone, move the Nest back to the target temperature as well.
Nest could support this directly by making the Protect act as a remote temperature sensor, but I'm not sure if the hardware even has this capability, let alone being exposed to the API.
You could still achieve the same effect by adding your own temperature sensors, but that would require additional research into what sensors are available.
Does anyone know if the use of only one static active RFID tag are able to detect motion(eg. moving human or objects) by itself without any use of other extra tags or sensors?
You could be able to do it by doing a permanent inventory and getting both the time and the signal strength received from the tag in each session. Both will be an indication that either orientation or distance has changed, but they are not exclusivelly corelated (you could have a change of both factors even if the tag is not moving) so you should do extensive test before settling on the solution.
Since you are talking about an active tag, there are manufacturers that incorporate motion sensors into their tag in order to save battery (tag emits more often when its moving), so you should contact them to see which of them can allow you to gather data from the sensor.
If you are thinking about fixing the tag on a wall and have the tag detect when someone passes by it, I do not know that such a product exist: there are tags that have thermometers or even humidity sensors integrated but not area of interest motion detection, for this you can use a wireless motion sensor.