Does anyone know which control is used to automatically recognize objects in photos and achieve the function of cutout by right-clicking the mouse?
You can detect rectangles, faces, barcodes, and text in images using the Vision framework. The Detecting Objects in Still Images and the Highlighting Areas of Interest in an Image Using Saliency sample code projects demonstrate this functionality. You can crop a CIImage
to a specific rectangle using cropped(to:), as mentioned in the Cropping Images Using Saliency article. To present a menu when the user right-clicks, you can override the rightMouseDown(with:) method in your NSView
or NSViewRepresentable
.