Ask Your Question

Yaoming's profile - activity

2016-05-21 14:14:03 -0600 received badge  Nice Answer (source)
2016-05-21 14:13:20 -0600 received badge  Student (source)
2014-05-02 03:26:21 -0600 received badge  Teacher (source)
2014-05-02 03:10:07 -0600 received badge  Scholar (source)
2014-05-01 08:04:31 -0600 answered a question background subtraction with a moving camera

I managed to solve my problem, thanks for your reply anyway :)

2014-05-01 06:03:45 -0600 received badge  Self-Learner (source)
2014-05-01 05:37:27 -0600 answered a question Trouble finding a way to differentiate two shapes

Problem solved thanks to Steven and his very nice idea! Indeed, he thought about something which is very simple but that I didn't see: algaes are attached to the ground and fishes aren't. Meaning that if we compare the x coordinate of each center of each shapes, we can deduce what's a fish and what's not.

To help those having a similar problem here's how I did it using openCV.



The solution, in details

First, you need to get the contours of your image/video frame (using findContours on a thresholded image).

Second, you need to get the openCV moments for each shape (simply go through your contours returned vector and apply the moments function each time). You can now easily calculate the center of each contours and put it in a list so that you can calculate the variance (have a look at the doc)

Then I created another list to keep the x-variance between each center. By "variance" I mean a simple subtraction (coordX[i] - coordX[i-1] with i running from 1 to (your list length - 1)).

And basically after that you only need to set a threshold and if your variance is higher, then it's a fish (because it moved more than the algae).



Other ideas

I also tried to work with colors but with the sudden and unpredictable lighting condition in an underwater environment, didn't get nice results. Getting the number of edges for each shapes was a good idea as well but not radical enough (I still had algae here and there on my video). Using the solution described above, I have exactly what I wanted :)

Thanks again for helping me, I hope this will help future students :)

2014-04-30 08:45:25 -0600 commented question Trouble finding a way to differentiate two shapes

Actually with water flow, the algae are moving as well. And I use background subtraction + thresholding + findContours + moments + arcLength + other not OpenCV things to get here. So I've already used the movement. And describing how smooth the edge of my objects contours are is what I'm trying to do now.

2014-04-30 05:56:29 -0600 commented question Trouble finding a way to differentiate two shapes

I just tried switching the color space but the results are not good. The detection is less precise. Anyway I've got a thresholded image and I'm quite happy with the results I have. The last thing I need to do is removing the remaining noise now and then. Colors ain't help me for that, or I might have misunderstood what you implied. If you had the exact image I put in my question, and were asked to show only the fish, how would you do?

2014-04-30 05:15:43 -0600 commented question Trouble finding a way to differentiate two shapes

Colors are not usable since I am in an underwater environment (which means a lot of lighting variations). Working with the inner pixels is cool but once again I'll always have one algae that'll be taken by my algorithm. Basically, every algae are very different from the fishes but I don't know how I could use that in real-time. There's no openCV function that simply says if a shape is smooth or not?

2014-04-28 04:43:45 -0600 asked a question Trouble finding a way to differentiate two shapes

Hello,

I am trying to automatically detect fishes in an underwater environment. I have this type of image (after having preprocessed the video input):


image description


Clearly the fish shape has less edges than the bottom algae one. Basically what I would like to do is to either be able to get the aspect of my contour or to get the number of edges of each contours to differentiate my fish from my algae.

Do you have any idea of how I could do that using Python ?
Do you have any other suggestions on how I could differentiate these two shapes ?

Thanks in advance for your answers.

2014-04-23 03:40:07 -0600 answered a question background subtraction with a moving camera

Nobody can help? I mean, if somebody who already has had to do such thing was kind enough to explain to me his method, that would really help!

2014-04-15 05:06:33 -0600 received badge  Critic (source)
2014-04-11 08:05:33 -0600 received badge  Supporter (source)
2014-04-11 05:12:16 -0600 received badge  Editor (source)
2014-04-11 05:10:56 -0600 answered a question background subtraction with a moving camera

Hello there,
I'm having the same problem: subtracting two frames works just fine with a static background but I'm dealing with a moving camera as well. Anyone has any ideas on how to do get rid of a moving background?

Actually, my situation is the following: I need to detect moving submarine wildlife, but I get a lot of useless info (other moving things that aren't useful at all ->seaweed etc...) and the camera moves, so the background changes.
Any help will be much appreciated, (I'm not specifically asking for code, what I would like to have are ideas, because I'm running out of those)
thanks in advance for your replies.