Relating user modified Ellipse ROIs back to original image

34 views
Skip to first unread message

olit...@gmail.com

unread,
Dec 21, 2016, 2:50:25 PM12/21/16
to pyqtgraph
I am new to pyqtgraph, but have been trying to figure this out for several days and not yet succeeded. I love the promise of pyqtgraph and want to make it work for this project, but I can't solve the problem

My project involves taking ellipse contours from OpenCV, viewing them as an ROI in an ImageView and allowing a user to modify their dimensions, including angle.

After a bit of a headache I have got the ROIs imported and displayed correctly on the image sequence, with the appropriate ROI for each image. The two complicating factors with this were i) determining the bottom most corner of the rotated bounding box to use as the origin for the ellipse and ii) if the ROI was at an angle, for some reason I had to make the width negative, whereas for ROIs at 0 or -90 the width had to be positive. 

I now need to take the modified ROI measurements to use in downstream image analysis in OpenCV. However, as soon as I modify the ROI, record the changes (I have tried roi.getGlobalTransform(), roi.pos(), roi.angle(), roi.size()) and try to view it in OpenCV, they are in the wrong places. Furthermore, if I change the angle, the ROI shifts markedly and more than a few degrees sends it outside of the scope of the image.

Firstly, should what I am attempting to do be possible (take ROI size and angle modifications, and relate them back to an image) and secondly can anyone suggest what might be causing the behaviour I describe..? 

Any help gratefully received!!

Oli
Reply all
Reply to author
Forward
0 new messages