Results 1 to 5 of 5

Thread: Cropping an image in qt

  1. #1
    Join Date
    Mar 2011
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Symbian S60

    Question Cropping an image in qt

    Hi Im new in Qt like for 3 weeks and Im currently developing an extensive application.

    For the first app im making I had difficulties on the following and I need urgent help.
    A big Thanks for those who will be able to help me.

    I researched a lot and used different types of techniques but not of these work, I need suggestions, codes itself if possible.

    Untitled.jpg To Untitled2.jpg

    Pls tell me what to do even how extensive they are.

    I used SetClipPath but i cant seem to make it work.
    Attached Images Attached Images
    Last edited by Johncdy; 10th March 2011 at 14:09.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Cropping an image in qt

    There is no one function call you can make to do it. You need to apply an algorithm for detecting areas of similar color. Not much Qt can help you with here, the algorithm will be the same regardless of the technology you use.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2011
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: Cropping an image in qt

    The method I used is creating a polygon from QPointF or QPolygonF and based from that polygon having the same shaped I want to clip the polygon created into the original image.

  4. #4
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Cropping an image in qt

    Hi,

    You can use OpenCV libraries to do this. Take a look at segmentation algorithms.
    To use OpenCV with Qt there are a lot of posts about it, so use the search tool to view them.
    Òscar Llarch i Galán

  5. #5
    Join Date
    Mar 2011
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: Cropping an image in qt

    Is there a better way to d this using only whats in Qt itself?
    I'll change my question, I need to clip a hexagon in the middle of an image.
    Is that possible? I only see rectangle examples on the net.
    Thx

Similar Threads

  1. Image: out of memory, returning null image
    By darek_hecpl in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 22nd September 2010, 14:48
  2. Replies: 6
    Last Post: 21st September 2009, 11:55
  3. hide image,once moused moved from image
    By yuvaraj.yadav in forum Qt Programming
    Replies: 1
    Last Post: 22nd April 2009, 09:16
  4. How can we compare if one big image contains a small image?
    By learning_qt in forum Qt Programming
    Replies: 1
    Last Post: 13th March 2009, 10:20
  5. Replies: 3
    Last Post: 14th March 2007, 09:09

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.