6 Replies - 2978 Views - Last Post: 22 June 2010 - 03:19 PM Rate Topic: -----

#1 DarkGuardsman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 21-June 10

Find part of an image

Posted 21 June 2010 - 06:10 PM

Hi i'm some what new to programming but i'm a fast learner. I'm looking for a way to find a small image inside a large one. Then plot the location of that part of the larger image. Followed by drawing a box around it on the screen.
The image i'm using is a screen shot of desktop. I want to find any icon on the desktop and show where it is. Posible move the mouse pointer to its location. Any suggestions, links, code bits will be helpful but dont say start with something simple.

Is This A Good Question/Topic? 0
  • +

Replies To: Find part of an image

#2 bytelogik  Icon User is offline

  • D.I.C Head

Reputation: 22
  • View blog
  • Posts: 212
  • Joined: 06-October 09

Re: Find part of an image

Posted 22 June 2010 - 01:11 AM

DarkGuardsman,

What you are trying to do is an important section of image analysis. I have a Sony Cybershot digital camera with face detection facility, which draws a bounding box around faces it detects. But at-least, all faces have similar parts like eyes, nose, etc.

Now detecting icons from the captured desktop image is difficult as it contains more noise (no consistent pattern)

You may need edge detection routines to find out effective and minimal image information.
1) Make your image gray-scale
2) Add Gaussian Blur (removes noisy pixels)
3) Detect Edges

Next, you need to find maximum spaces (horizontal as well as vertical) between the icon image edges so that you can point out to individual icon images. From here on, you can think for getting the icon image bounding box.
Once you get icon image bounding box, you can trim the icon image using Win32 API.

I know this is difficult, but working on it continuously will certainly make things easier.

I have attached an image. See if it is useful for you.

Hope this helps.

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#3 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: Find part of an image

Posted 22 June 2010 - 08:00 AM

i think he is try to create a remote desktop
Was This Post Helpful? 0
  • +
  • -

#4 bytelogik  Icon User is offline

  • D.I.C Head

Reputation: 22
  • View blog
  • Posts: 212
  • Joined: 06-October 09

Re: Find part of an image

Posted 22 June 2010 - 08:57 AM

@thava : I don't think so, because capturing image of the entire desktop would be sufficient for any remote desktop application. Or he can get shortcuts present on the desktop using Win32 API and access the applications to which the shortcuts belong. But he wants parts from an image, especially icons from the desktop. I don't no why ?
Was This Post Helpful? 0
  • +
  • -

#5 DarkGuardsman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 21-June 10

Re: Find part of an image

Posted 22 June 2010 - 01:28 PM

I'm trying to make a program that can find an icon in all the mess on my desktop then mark it for easy find. I keep cleaning the icon, folder and links but they just build up. Meaning i lose track of icons and have to spend 5 mins to find the link or folder icon i'm looking for.
Was This Post Helpful? 0
  • +
  • -

#6 bytelogik  Icon User is offline

  • D.I.C Head

Reputation: 22
  • View blog
  • Posts: 212
  • Joined: 06-October 09

Re: Find part of an image

Posted 22 June 2010 - 02:14 PM

DarkGuardsman,

Assuming that you just want to run/edit/delete the shortcut link to activate the program associated with the icon on the desktop, you may not require to get into difficult image analysis routines.
All the icons on the desktop are stored as files in the Desktop folder. Right click on one of desktop icon, and you will find the path of the shortcut/icon in the General tab.
Using simple file reading functions, you can scan through the shortcut files in the Desktop folder for specific program name you want to search for. Once you get the shortcut link, open the link file using program, get the file associated with it and execute it. You should have little experience of string functions like InStr, Left, Mid, etc., to extract the associated file path of the icon.

Hope this helps.
Was This Post Helpful? 0
  • +
  • -

#7 DarkGuardsman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 21-June 10

Re: Find part of an image

Posted 22 June 2010 - 03:19 PM

what i'm trying to do is more around just find and show the icon on screen. That way i can mark the location for other part of my program to click it. In truth i'm making an automated system to run a program. Like open program-> Start a process -> type some info -> save -> close program -> then open another program. sorry i didn't say this before.

Also could you give me some links to image analysis code bits and Tutorials.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1