How can I get the position of an identified object in Scikit-Learn? - machine-learning

I can use Scikit-Learn to train a model and recognize objects but I also need to be able to tell where in my test data images the object is residing. Is there someway I could maybe get the coordinates of the part of the test image which has the object I'm trying to recognize?
If not, please refer me to some other library that'll help me achieve this task.
Thankyou

I assume that you are talking about a computer vision application. Usually, the way that a box is drawn around an identified object is by using a sliding window and running your classifier on each window as it steps across the screen. You can keep track of which windows come back with positive results and use those windows as your bounds. You may wish to use windows of various size, if the object scale changes from image to image. In that case, you would likely want to prefer the smaller of two overlapping windows.

Related

How to retrieve focused part of image using AVDepthData

I've been trying to implement some code where, given an image with some depth data, it specifically returns the part of the image that is focused/closest to the camera. If it's a person, then their face, if it's a plant then the branch. Effectively I'm trying to get the part of the image which would be focused on if the image was taken using Portrait mode on the camera app.
I've been reading this documentation but I've not been able to think of a way to manipulate the data here. My guess would be to use embedsDepthDataInPhoto and then use the depth data in some way to get rid of all other parts of the data if they are a certain distance away or greater from the camera. I'm quite new to this so any help would be greatly appreciated

Placing Virtual Object Behind the Real World Object

In ARKit for iOS. If you display a virtual item then it always comes before any real item. This means if I stand in front of the virtual item then I would still see the virtual item. How can I fix this scenario?
The bottle should be visible but it is cutting off.
You cannot achieve this with ARkit only. It offers no off the shelve solution for solving occlusion, which is a hard problem.
Ideally you'd know the depth of each pixel projected on the camera, and would use that to determine those that are in front and those that are behind. I would not try something with the feature points ARKit is exposing since 1) their position is innacurate 2) there's no way to know between two frames which feature point of frame A is which feature point in frame B. It's way to noisy data to do anything good.
You might be able to achieve something with third party options that'd process the captured image and understand depth or different depth levels in the scene, but I don't know any good solution. There's some SLAM technique that yields dense depth map like DTAM (https://www.kudan.eu/kudan-news/different-types-visual-slam-systems/) but that'd be redoing most of what arkit is doing. There might be other approaches that I'm not aware off. Apps like snap do this in their own way so it is possible!
So basically your question is to mapping the coordinate of the virtual item on real world coordinate system, in short, you want to see the virtual item blocked by the real item, and you can only see the virtual item once you pass the real item.
If so, you need to know the physical relations of each object in this environment, and then you need to know exactly where you are to decide if the virtual item is blocked.
It's not an intuitive way to fix this, however, it's the only way I can think of.
Cheers.
What you are trying to achieve is not easy.
You need to detect the parts of the real world that "should be visible" using some kind of image processing. Or maybe the ARKit feature points that have the depth information, then based on this you have to add "an invisible virtual object" that cuts the drawing of things behind it. This will represent your "real object" inside the "virtual world" so that the background (camera feed) remains visible in places where this invisible virtual object is present.

image processing close edge matlab

I have the following image
What I need to do is connect the edges in MATLAB that are obviously of the same object in order to use regionprops later. By 'obviously' I mean the edges of the inside object and those of the outside one. What I thought is that I somehow must keep the pixels of each edge in a struct and then for each edge find the one that is closer to it and then apply some fitting(polynomial, bspline etc). The problem is that I have to make it for thousands of such images so I need a robust algorithm and I cannot do it by hand for all of them. Is there a way for somebody to help me? The image of which the previous image is obtained is this one. Ideally I have to catch the two interfaces shown there.
Thank you very much in advance

Whats the best way to check whether one image is somewhere on/similar to another image?

I want to use openCV to check whether an image is somewhere on another image. This other image could also be a photo. I dont want to know the position or anything, I just want to know whether the image is there or not - or, if the images are "equal enough".
Example: I use my iphone to take a photo of a static object. Now, one day later I take this photo again and I want to check if it is the mostly the same object.
Whats the best way to do this? I alos tried CVMatchTemplate (but was not able to get a working check) and CVNorm.
Maybe SURF (Speeded Up Robust Features) can to this.
I used it to check if an template image can be found on objects along an moving conveyor belt.
Have a look on this page, it describes the usage of SURF with the EMGU-OpenCV wrapper classes.

recognize the moving objects and differentiate them from the background?

iam working in a project that i take a vedio by a camera and convert this vedio to frames (this part of project is done )
what iam facing now is how to detect moving object in these frames and differentiate them from the background so that i can distinguish between them ?
I recently read an awesome CodeProject article about this. It discusses several approaches to the problem and then walks you step by step through one of the solutions, with complete code. It's written at a very accessible level and should be enough to get you started.
One simple way to do this (if little noise is present, I recommend smoothing kernel thought) is to compute the absolute difference of two consecutive frames. You'll get an image of things that have "moved". The background needs to be pretty static in order to work. If you always get the abs diff from the current frame to the nth frame you'll have a grayscale image with the object that moved. The object has to be different from the background color or it will disappear...

Resources