OpenCV is a cross-platform library that can be utilized to develop real-time computer vision applications. It principally concentrates on image processing, video capturing, and analysis.
The best part is there is the Delphi-OpenCV library for Delphi developers. Delphi-OpenCV is a translation of OpenCV library header files in Delphi.
You can find all the required libraries for this library from its repository on GitHub. And also, the installation process is guided there.
What can you do with OpenCV?
- Object sorting
- Biometrics
- Autonomous vehicle
- Analyze and process images
- Human-Robot Interaction
- Obstacles avoidance
- Detection and classification
- Vision-guided robotics operation
- and many more!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
procedure TMainForm.DetectingRedObjects(img: pIplImage); Var imgHSV: pIplImage; imgThresh: pIplImage; frame: pIplImage; begin frame := cvCloneImage(img); // smooth the original image using Gaussian kernel cvSmooth(frame, frame, CV_GAUSSIAN, 3, 3); imgHSV := cvCreateImage(cvGetSize(frame), IPL_DEPTH_8U, 3); // Change the color format from BGR to HSV cvCvtColor(frame, imgHSV, CV_BGR2HSV); imgThresh := GetThresholdedImage(imgHSV); // smooth the binary image using Gaussian kernel cvSmooth(imgThresh, imgThresh, CV_GAUSSIAN, 3, 3); ipDraw(pb1.Canvas.Handle, frame, pb1.ClientRect); ipDraw(pb2.Canvas.Handle, imgThresh, pb1.ClientRect); // Clean up used images cvReleaseImage(imgHSV); cvReleaseImage(imgThresh); cvReleaseImage(frame); end; |
Be sure to check out the Delphi-OpenCV library for Delphi!
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition
Thank you for sharing it. 👍
this is old library. need to upgraded to ver. 4
Ah yes, sorry about that oversight (pun intended). It appears that the Open CV project removed C language library support – this was deliberate although they don’t explain why. ¯\_(ツ)_/¯
Luckily there are some other ways to use v4 of Open CV with Delphi, We list some of those ways here: https://blogs.embarcadero.com/5-ways-to-use-computer-vision-in-your-windows-apps/
I also suggest taking a look at Mitov software’s solutions – they are very reasonable and excellent quality: https://www.mitov.com/products/visionlab#overview
The Mitov products look interesting, in fact I have been working with VideoLab and VisionLab, however support is non-existent, no one answers emails. The DirectShow based objects only work partially.