Hi wilbert,
You're very much welcome.
--------------------------------------------------------------------------
All the examples have been updated for better stability, including four additional examples.
-
cv_convexhull_1.pb: finds the convex hull of a point set
-
cv_setimageROI.pb: simulates zooming a section of a resized image by loading the Region Of Interest (ROI) for a given rectangle from the original image
-
cv_stereobm.pb: computes disparity using the BM (Block Matching) algorithm for a rectified stereo pair of images
-
cv_transparent_1.pb: using the watershed algorithm, an object can be extracted and saved to a transparent PNG file
Instructions for cv_transparent_1.pb
- draw a connected outline around the inside of Lena (accuracy not needed)
- draw a vertical line to the left of Lena
- draw a vertical line to the right of Lena
- draw a horizontal line above Lena
- press the Spacebar to apply the marked regions
- double-click the center of Lena to extract her from the image
- press the Spacebar if you want to modify the selected area
-- connecting new lines to previous lines will expand the marked region
- save the image to a PNG (transparent) file
- press enter at anytime to reset the image
--------------------------------------------------------------------------
There was a problem with one of the new examples accessing the Double-Clicked event...
The following information was provided by
wilbert:
wilbert wrote:If you look at the
cvMouseEvent function in the
window_cocoa.mm file, You will see OpenCV simply doesn't implement double click on OSX.
OSX has no special double click event. Instead it counts the amount of clicks that are in between a double click interval.
That way double clicks can be detected but also triple or more.
You can set a global value for NSApp since it doesn't change while the application is running
Code: Select all
Global NSApp = CocoaMessage(0, 0, "NSApplication sharedApplication")
Now in the mouse callback, try this
Code: Select all
Debug CocoaMessage(0, CocoaMessage(0, NSApp, "currentEvent"), "clickCount")
You'll see it shows the number of mouse clicks.