PDA

View Full Version : Cropping an image in qt



Johncdy
10th March 2011, 10:17
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.

6065 To 6067

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

I used SetClipPath but i cant seem to make it work. :(

wysota
10th March 2011, 10:21
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.

Johncdy
10th March 2011, 10:26
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.

^NyAw^
10th March 2011, 11:19
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.

Johncdy
10th March 2011, 13:08
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