void
void

Reputation: 718

Scanning for a picture within another picture in Objective-C

I want to know if my display (or some window) contains a picture. I think to do the following:

  1. take a snapshot from a display.
  2. scan this snapshot to see if it contains my picture.

How can I scan a picture in an Objective-C Cocoa app?

Upvotes: 1

Views: 253

Answers (1)

vbence
vbence

Reputation: 20333

I suggest to scan your picture first with some rudamentary feature detection. You can blur it and find big opaque regions. Then you can do the same with the captured screen. This way you can find the "center of gravity" of your picture on the screen. Then you can do bit-by-bit comparasm with a small trashold to finetune the position.

When you have the exact position you can do a last step, a bit-by-bit comparsion for the whole picture area to be sure that your picture is fully displayed (no parts are blocked out by other windows) if this is interesting for you.

Upvotes: 1

Related Questions