Computer vision - two frames, overlapping bounding boxes - object-recognition

A bed is there in a room at some x, y position. On the bed, there's an apple at the center of the bed.
Now my code should give an output that there's an apple at the center of the bed, or like an apple on the top left corner of the bed.
Can someone pls help me to know if how could I solve this problem using YOLO/OpenCV/Tensorflow/Torch, etc?

I will answer for Yolo. What are you looking for is nested or overlap detection right? It can be done using Yolo. 1 important thing, when you annotating your dataset, you have to include the nested example as well. If you only label bed and apple as separated object in your dataset, Yolo won't detect the nested object. You also have to include image where there is apple on top of the bed, and draw 2 bounding boxes for each object. See :
Example credits to pkhigh on github :


What TeeChart Tool can I use to Interactively select points from a FastLine Graph

While using Delphi Seattle 10 and Steema TeeChart Pro VCL FMX 2016.18, I am looking to Highlight a Selection of a Line Graph (multiple series) in the way that Zooming allows / makes a square around a highlighted selection of a Line Graph to indicate which part of it to zoom into (as long as the onmousedown action is in progress).
The purpose of this would be to allow the selection to remain highlighted while the mouse is no longer being clicked, to potentially "Delete" the highlighted Data points. All I need this for is to obtain the (X0 Y0 X1 Y1) values to possibly obtain the CalcPosPoint(X) and remove all the points inside. The data is currently obtained through a Record Struct (Memory Mapped) file, and it will there for be used to set/check for a property "deleted" to indicate on the next redraw of the graph which rows to completely ignore and which to continue printing.
I hope to be able to do this (select from 1 chart), and have it simultaneously draw on multiple graphs. I have tried to look for an example of this feature through the use of TSelectorTool (FMXTee). One of the pages I found referring to such a tool is Interactive data point selection as well as Multiple selections with Selector Tool
And my second question has to do with TeeCharts directly. Where would I find fmx240.bpl as TeeChart_Pro_Firemonkey_Demo.exe requires this file in order to run? I did manage to copy vcl240.bpl from "Embarcadero\Studio\18.0\bin" and put it into "Embarcadero\Studio\17.0\bin"
I have managed to capture / create a sample code (MVCE) from which I can now select a portion and create a square around a particular sample of graph lines.
The control graph right now is the bottom graph (Chart5). If anyone is interested in seeing the code, I have put up a pastebin sample.
PasteBin Sample Code
And a TeeCharts.tar.gz is accessible to anyone who wishes to see a sample of the code, as well as the data sample. Source Files
I no longer feel the need for mathematical equation to differentiate the top graphs from the bottom (because the bottom axes are automatic where as the top are defined). I intend to only use the space which is adherent to the visible space, and do not intend to extend in either direction (left or right). That means at this point the size of the graph does not matter, because once I over populate the charts above, the position in the bottom graph would become irrelevant, and therefor I do not intend to use the bottom chart.
The next step is to save the positions of the boxes so that they can reappear when the graph is shift from left (past data) to the right (live data). And then uses the buttons above to make the appropriate action to the graphs.
I would like to know what way would be the most sufficient way to record the positions of the rectangles, so when the chart is shifted (via the ScrollBar1), the rectangles are moving with the direction of the scrollbar. But I'm sure I can achieve that.
I think I have found a solution. The red squares are only prevalent for the visual aspect, they can be drawn on, I don't need to do anything special with each chart, as I already know what the X0..Y1 parameters are, they are known from the initial chart. The problem h/e has to do with the initial chart. As long as the screens are all full, I can zoom in correctly w/ alignment with on all the charts (ZoomRect/Rectf(X0..Y1))
But what kind of equation would it take to adjust the charts that are not in the same zoom / max / min when the Chart5.Axes.Bottom.Automatic = True?
From there I just simply have to disable the immediate zoom feature, and allow buttons to become functional, to decide what the next course of action would be.

Is there any kind of particle emitter on Android like iOS CAEmitterLayer for circle emitter?

My issue is difficult to resolve as of now.
I am supposed to develop an Android application alongside my colleage that does the same thing but on iOS.
At the end of the development, we are supposed to deliver two applications that do the same thing and look alike (be reassured, nothing like iOS guides-lines forced on Android and vice-versa) so that the experience is the same and immersive.
One of the top feature to provide, is a nice looking animation of a white empty circle that emits snow-like particles inside the circle. The circle can move via scrolling or simply bouncing/sliding animation.
So imagine a circle with a white border and white particles going off that white membrane. All those particles are drawn to the center and their speed base is variating (but no accelaration !). The fastest particles are suppose to "die" before reaching the center. Something that can easily be set via settings for lifetime and speed of course.
My partner, who is a junior like me, is using iOS' CAEmitterLayer and the results she obtained within a day or two is gorgeous and really close to what we are supposed to achieve.
On my side I am really struggling. Like her, I don't really have any experience in any animation and UI/UX.
While looking for a particle generator/emitter on Android, I stumble upon this good-looking library : and it seems it can offer what I am looking for.
But I have a few unresolved issues using this library :
I cannot or do not know if I can place emitters inside a circle ;
I believe that if the circle, on which the emitter is hooked, is moving (scroll/animation) there is a strong possibility that the particles won't move with the circle ;
As I said, my iOS colleague resolved these issues. Even the moving part: we were talking with our manager that told use "what if the circble moves ?" and she immediately tried it in front of us. I was blown away...
She told me I should be looking for a way to contain my particles inside a container (makes sense ^^) and that my circle view should be clipped with layers so that the particles won't leave the circle especially if the whole thing is moving.
This is what I have achieved this thanks to the aforementioned Android library :
I can emit particles, define their shape, their scale/size, their speed and somewhat the angle of emission ;
I can hook up a particle emitter to a view. It will use the view X&Y coordinates to emit the particles but the problem with a XML-based circle drawable like here is that it's contained inside a square-based view (with a height and a width) and for strange reason, my circle is draw above that said squared-based view.
I hope I can find another library but if the current one is working, why not ? Just trying my luck out there ^^
Thanks for the help !
The library author of Leonids made a suggestion that might help you achieve the desired effect :
plattysoft commented on Sep 19, 2016
Interesting, this is not currently supported, but you could make fork and tweak the library to
add an initializer that takes a radius and spawns particles around
that with a random angle.
The second part it to get attracted by the center. That should be a
modifier or maybe an initializer where the acceleration depends on the
Tricky, and not supported directly, but doable.

How to link controls, Mind Mapping style

I am trying to create a Mind Mapping look for an application I'm working on, where I need to link boxes with lines or arrows.
This is what I have so far:
And this is what I would like to achieve:
I can move and resize the boxes around, but after days of trials and research, I just can't figure out how to have the user add links to the boxes and have the lines recalculated and change their angles/lengths when the user moves the boxes around.
Even though part of this app uses Direct2D, I do not want to start rendering the boxes myself, due to time constraint.
I was going to revert to a less visual TreeView using VirtualTreeView, but I wish I could get this to work.
Can someone provide tips on how to accomplish this or know of existing components I could use?
As Sertac Akyus sad in comments all you need is two reference points to be able to draw a line.
And you can simply go and draw a line on the canvas of the parents controll of your boxes using LineTo command.
If we take a look at your example. Drawing a line between Box1 and Box2 can be done using folowing procedure:
//Move point to the bottom midle of the Box1
Parent.Canvas.MoveTo(Box1.Left+(Box1.Width div 2),Box1.Top+Box1.Height);
//Draw a line to the top middle of the Box2
Parent.Canvas.LineTo(Box2.Left+(Box2.Width div 2),Box2.Top);
Now you need to pay special attention which of your controlls is higher so that your line doesen't necessarily cross it buzt instead only leads to its border.
You could even make life yourself a bit easier by simply drawing line from the center point of one box to the center point of another box like so
//Move point to the center of first box
Parent.Canvas.MoveTo(Box1.Left+(Box1.Width div 2),Box1.Top+(Box1.Height div 2));
//Draw a line to the center point of second box
Parent.Canvas.LineTo(Box2.Left+(Box2.Width div 2),Box2.Top+(Box2.Height div 2));
But this might not look as good as first aproach would.
Anywhay with mind graphs sooner or later you would probably run into situation where drawing straight lines would not be god enough.
In such cases you would want to offer support for drawing curved lines (athleast drawing of S curves). With these you need to provide your user with the ability to adjust them propery so that they won't be crossing othe boxes. But that requires the ability for user to select specific line and then ajust certain properties of it.
Another advanced approach that you might want to use is automatic curve drawing. Such approach uses the pathfinding algroithm in the background to find multiple reference points representing posible line path and then the ability to render Catmul-Rom spines through these reference points.
Unfortunately I can't offer you any code examples for this advanced aproach as I'm still trying to implement it myself.
I ended up going for drawing the arrows myself. What I did was to place a TImage under the controls, and draw arrows in between the control's anchor points.
Since this will be an in-house editor, there's no need for advanced drawing or line management.
I then decided to draw antialiased lines, which TCanvas does not support, so I installed Graphics32 and using LineToAS() the lines looked great.
But after looking at TMS Diagram Studio demo, the need to reinvent this wheel is fading. It seems as it contains everything I need and then some.
Thanks to all for the comment!

Auto rotate the bottom of the house to the line

I just wanna ask you way to do this.
How can auto rotate the house object to the line which is bottom align to the line, when the user moves the house to the line. (see example)
I know black dot and house's coordinates.
I implemented this, following coproc's advice. Unluckily, the code is a little to lengthy to post here, but you can read it and check it working online in wonderfl:
Most relevant code lines are commented, the only assumption is that the house's graphic registration point is at its center (in my case I drew a Sprite, but it should work just as well with any MovieClip). I think it accomplishes quite well what you are looking for.
Hope this helps!

D3.js pie chart labels for slices not tweening

When I click on the various hyperlinks to tween my chart: while the pie's slices are tweening but I cannot figure out how to bring along each slice's label.
A mostly working JSfiddle is here:
Thanks in advance for any insights you can provide me. I promise to update the fiddle with whatever solution we discover as I imagine this effect is of interest to a great many D3'ers.
The main issue here is in your updateChart function - while you rebound the data to arcs, you did not do so for sliceLabel: (second line added); // recompute angles, rebind data;
One other small thing - your slice label text selection seems a little bit strange:
var sliceLabel = label_group.selectAll("text.value")
but you are creating no text with class = "value"; this doesn't really end up affecting much, but might cause problems in other implementations - selectAll("text") or selectAll("text.arcLabel") might be more appropriate here.
updated fiddle at