Results 1 to 5 of 5

Thread: Find pixmap in pixmap

  1. #1
    Join Date
    Aug 2012
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Find pixmap in pixmap

    First of all sorry for my english mistakes.

    I am new to QT and got the next goal that has not yet found the way to do it:
    Finding a pixmap within another pixmap , or QImage within QImage.
    For you to better understand if and how the image was a pixmap of a window, and the other was the pixmap print the full desktop screen and then find the function in the desktop window and return the coordinates.

    Any help will be very welcome, I need an idea of ​​where to seek this solution.
    Thank you.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Find pixmap in pixmap

    What do you mean by "Pixmap within a pixmap"?
    How did you achieve that nested pixmap?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Aug 2012
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Find pixmap in pixmap

    It is well friend, I have a pixmap1 with the image of a window, and I have another pixmap2 with the image of the work area complete with a window contained in it, so I want and that is found pixmap1 in pixmap2 and I get the position x , where y is found.
    Thanks for helping me!
    Last edited by mizim; 7th August 2012 at 16:06. Reason: updated contents

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,552
    Thanks
    13
    Thanked 1,579 Times in 1,508 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Find pixmap in pixmap

    I cannot see any trivial out-of-the-box way to do this, even for images that are perfectly lossless (forget it if you have lossy images like JPEGs). Pure brute force. You have to scan the containing image pixel-by-pixel for pixels matching the top-left pixel of the contained image. Once you have found a possible matching location you have to check the other pixels of the containing and contained images. As soon as a pixel no longer matches you can skip to the next possible top-left match.

    If these images are screen shots then the title bars and window borders, which are consistent, will cause the simple approach above to be inefficient because of many false positive matches. You may be better off checking pixels inside the images away from the borders.

    You might be able to improve efficiency with an image analogue to the Boyer-Moore string search algorithm.

    If the contained image is not arbitrary, e.g. a yellow circle, then this might be of interest. OpenCV may be of use.
    Last edited by ChrisW67; 7th August 2012 at 23:33.

  5. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Find pixmap in pixmap

    As ChrisW67 mentioned, this issue is data analysis and/or pattern matching, it is not a Qt issue - libs dealing with such stuff as OpenCV are what you are looking for.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 1
    Last Post: 19th April 2011, 11:17
  2. To find X, Y position of a pixmap item in Graphicsscene
    By augusbas in forum Qt Programming
    Replies: 2
    Last Post: 21st January 2011, 06:09
  3. Rotating pixmap
    By jano_alex_es in forum Newbie
    Replies: 4
    Last Post: 19th December 2010, 04:00
  4. pixmap to polygon
    By mhoover in forum Qt Programming
    Replies: 1
    Last Post: 14th October 2009, 09:02
  5. pixmap
    By odee2004 in forum Qt Programming
    Replies: 3
    Last Post: 28th August 2009, 17:16

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.