Live data from Hacker News

Using Computer Vision to Win at Duck Hunt

blog.roboflow.com

21–30 of 30 posts

Re: Using Computer Vision to Win at Duck Hunt

#21
post #16

I don't understand this example. Duck Hunt has only a few sprites, maybe four or six. It's really easy to just scan the whole image and match those sprites, exactly pixel-by-pixel. This doesn't really need anything that could reasonably be called machine learning or computer vision. Synthetic 8-bit images can be handled with 8-bit algorithms. We don't need much art and we certainly don't need its state either. Why pi…

> This is blogspam

Looking at the domain and the author, I'd say it was a straight-up advert

Re: Using Computer Vision to Win at Duck Hunt

#22
post #14

> I annotated the images with Roboflow and was able to easily export the data > Roboflow's Dataset Health Check helped me > I found Roboflow’s Model Library to be the best > Roboflow would be my go-to platform > Matt Brems, Growth Manager @ Roboflow Please call this a demo or “how I use Roboflow to win a duck hunt”

You missed one:

> The user experience for preprocessing is amazing

Agreed, this was a bit over the top, but I could have improved my expectations by paying more attention to the domain name. :)

Re: Using Computer Vision to Win at Duck Hunt

#23
post #16

I don't understand this example. Duck Hunt has only a few sprites, maybe four or six. It's really easy to just scan the whole image and match those sprites, exactly pixel-by-pixel. This doesn't really need anything that could reasonably be called machine learning or computer vision. Synthetic 8-bit images can be handled with 8-bit algorithms. We don't need much art and we certainly don't need its state either. Why pi…

Compare current screen with previous screen, if something is moving upwards you shoot it. That's the only algorithm you need here.

Re: Using Computer Vision to Win at Duck Hunt

#24
post #19
post #16

I don't understand this example. Duck Hunt has only a few sprites, maybe four or six. It's really easy to just scan the whole image and match those sprites, exactly pixel-by-pixel. This doesn't really need anything that could reasonably be called machine learning or computer vision. Synthetic 8-bit images can be handled with 8-bit algorithms. We don't need much art and we certainly don't need its state either. Why pi…

I agree with you for the most part. This problem definitely doesn't require ML to achieve. However, if doing it with a classical approach (matching sprites) takes a person half a day, and doing it with the new fangled proprietary ml takes a person 20 minutes, I do see that doing it with the new fangled ml approach does have some merits. People want to get stuff done. I'm a barely passable programmer, so not exactly a…

Yeah, but in the classical approach your users don't need to have a GPU installed.

This seems to be a case of "if you're holding a hammer, everything looks like a nail".

Re: Using Computer Vision to Win at Duck Hunt

#25
I experimented with using super basic computer vision to cheat at videogames but It never worked quite right. My target was venge.io, pretty bad game but I can tamper with the files freely with some userscripts. I injected bright purple textures for all the characters and used a simple color range matching to find the target.

My choice of language was python with pywin32,numba and a screen duplication library which name I forgot. The biggest problem was that by the time I finished scanning the screenbuffer contents the enemies on screen have already moved.

If I had paid attention in university math classes I could've come up with a direction tracking and prediction system. :/

But then I threw the whole thing out the window and rewrote everything with good old fashioned readmemory()/writememory() :^)

Re: Using Computer Vision to Win at Duck Hunt

#26
post #16

I don't understand this example. Duck Hunt has only a few sprites, maybe four or six. It's really easy to just scan the whole image and match those sprites, exactly pixel-by-pixel. This doesn't really need anything that could reasonably be called machine learning or computer vision. Synthetic 8-bit images can be handled with 8-bit algorithms. We don't need much art and we certainly don't need its state either. Why pi…

Being charitable, Duck Hunt is a well know game and this might be considered a tutorial for the software's use using a simple problem. It does look like an advert blog post, but simple examples let people get a feel for the code.

Re: Using Computer Vision to Win at Duck Hunt

#27
post #16

I don't understand this example. Duck Hunt has only a few sprites, maybe four or six. It's really easy to just scan the whole image and match those sprites, exactly pixel-by-pixel. This doesn't really need anything that could reasonably be called machine learning or computer vision. Synthetic 8-bit images can be handled with 8-bit algorithms. We don't need much art and we certainly don't need its state either. Why pi…

Being charitable, Duck Hunt is a well know game and this might be considered a tutorial for the software's use using a simple problem. It does look like an advert blog post, but simple examples let people get a feel for the code.

> simple examples let people get a feel for the code.

There's no code in there. Just links to other articles and whatnot.

I vote for blogspam, too.

Re: Using Computer Vision to Win at Duck Hunt

#28
post #24
post #19

Earlier quoted context omitted.

I agree with you for the most part. This problem definitely doesn't require ML to achieve. However, if doing it with a classical approach (matching sprites) takes a person half a day, and doing it with the new fangled proprietary ml takes a person 20 minutes, I do see that doing it with the new fangled ml approach does have some merits. People want to get stuff done. I'm a barely passable programmer, so not exactly a…

Yeah, but in the classical approach your users don't need to have a GPU installed. This seems to be a case of "if you're holding a hammer, everything looks like a nail".

Edit: I'm pretty sure I missclicked to which comment I wanted to answer and now I can't find it... It said something along the ML approach being more developer-time efficient.

You can definitely do it in 20 minutes if you know how (which is also applicable to the ML version):

    import cv2
    import numpy as np

    red_duck = cv2.imread("red_duck.png", cv2.IMREAD_GRAYSCALE)

    # boilertplate etc, up to the point where you want to match your ducks on screen:

    res = cv2.matchTemplate(img_screen, red_duck, cv2.TM_CCOEFF_NORMED)
    positions = np.zeros_like(img_screen)
    positions[res > 0.7] = 1  # we found a duck
    # now do whatever you want with each position
    # on real life images you may need to do some additional post-processing, on 8-bit rendered images you probably don't need to

Re: Using Computer Vision to Win at Duck Hunt

#29
post #18
post #16

I don't understand this example. Duck Hunt has only a few sprites, maybe four or six. It's really easy to just scan the whole image and match those sprites, exactly pixel-by-pixel. This doesn't really need anything that could reasonably be called machine learning or computer vision. Synthetic 8-bit images can be handled with 8-bit algorithms. We don't need much art and we certainly don't need its state either. Why pi…

When all you have is a hammer

Don't really agree with this. It like saying "why did you use a phone to do that math when a simple calculator or even pen and paper would work"

Sure it would work, but the phone also works and does way more. You might be able to use some trivial processing on duck hunt but it won't work on anything slightly more complex so why would you bother learning a method that only works on the most basic of games when you can develop something that can be applied everywhere.

Re: Using Computer Vision to Win at Duck Hunt

#30
post #16

I don't understand this example. Duck Hunt has only a few sprites, maybe four or six. It's really easy to just scan the whole image and match those sprites, exactly pixel-by-pixel. This doesn't really need anything that could reasonably be called machine learning or computer vision. Synthetic 8-bit images can be handled with 8-bit algorithms. We don't need much art and we certainly don't need its state either. Why pi…

Agree. Detecting things that move doesn’t require rocket surgery.
Post reply on HN