Opencv University

Call Website Contact the school

Opencv University Take your first steps to Mastery in AI with our Free Bootcamp. Kickstarter Masters in AI Art Generation : bit.ly/3JYh7A6

Welcome to the world’s most trustworthy destination for learning Computer Vision, Deep Learning, and AI.

09/18/2026

NMS and IoU: How Detectors Clean Up Duplicate Boxes (and What It Can't Tell You)

An object detector can draw several boxes around the same car, and if we count every box, we count proposals as though they were separate objects. In this cybercab photograph, a local YOLO11n run produced 22 car candidates above a score of 0.25, and these are our model results on a photograph unrelated to Tesla's onboard software. Non-maximum suppression, or NMS, reduces those competing proposals, where each candidate has a confidence score.

First, NMS keeps the box with the highest remaining score, then measures how much each other box overlaps it using intersection over union, or IoU: the area shared by both boxes divided by the area covered by either box, counting the shared region once. An IoU near 1 means nearly identical coverage, and near 0 means little overlap. The highest scoring box scores about 0.90001, another scores about 0.897 with an IoU of about 0.987, and with an overlap threshold of 0.5, since 0.987 exceeds it, the lower scoring candidate is removed and the selected box stays. A different candidate scores about 0.538 with an IoU of only 0.038, so it stays available. Repeating this process leaves 3 retained candidates from the original 22, and their coordinates have not moved, because NMS selected existing boxes.

But those 3 survivors are not a verified count of 3 real cars. A high score does not guarantee a correctly placed box, and 2 real objects can overlap enough that 1 candidate is wrongly suppressed. Keep the two thresholds separate: the score threshold decides which candidates enter, and the overlap threshold decides which competing boxes are removed. NMS reduces duplication using scores and geometry. It does not establish what is actually present.

09/17/2026

Precision vs Recall: How the Threshold Changes Everything

Suppose we want to find the cats in 6 cat photos and 4 dog photos, with cat as the positive class and dog as the negative class. We'll use invented cat scores on real photos, so these are teaching examples, not results from a model. The rule is simple: a score at or above our threshold means predict cat, and anything below means predict dog.

Start with a threshold of 0.25. Now 7 photos are predicted as cats, but only 5 actually show cats, so those 5 are true positives and the 2 dogs are false positives. Precision asks, of everything we called a cat, how much was right, which is 5 divided by 7, about 71.4%. Recall starts from a different group, all 6 actual cats, of which 5 were predicted as cats and 1 was missed (a false negative), so recall, of all the cats present how many did we find, is 5 divided by 6, about 83.3%. The numerator is still 5, only the denominator changes.

Now keep the same photos and scores, but raise the threshold to 0.65. Only 2 photos receive the cat label, and both really are cats, so precision becomes 2 out of 2, or 100%. But 4 cats are missed, so recall falls to 2 out of 6, about 33.3%, and that perfect precision does not mean every cat was found. Raising the threshold improved precision here, but that is not guaranteed with fixed scores. What is guaranteed is that raising the threshold can only remove cat predictions, so recall cannot increase. Choose your threshold by weighing both kinds of error: missed cats, and dogs incorrectly called cats.

09/16/2026

YOLO27 vs YOLO26: What to Know Before You Upgrade

YOLO27's preview numbers look impressive, but before you replace YOLO26, there are two things worth knowing, and one could change your decision. First, how much better does it look? For the smallest models, Ultralytics reports a COCO detection score of 39.5 for YOLO11, 40.9 for YOLO26, and a preliminary 42.3 for YOLO27. That is a real improvement, but it does not mean the model detects 42% of objects, since the score measures both recognition and how accurately it places the boxes. Second, YOLO27 changes its detector design depending on size: the small version uses a streamlined convolutional network, while the larger versions use object queries, which you can think of as slots that get refined into final detections. So choosing a larger version means more than simply adding extra layers.

Now the catch. These are preliminary numbers, and you cannot download YOLO27 and independently test it yet. And do not compare headline speed numbers measured on different GPUs, because a faster looking chart does not automatically mean faster performance on your machine. My recommendation is to keep your working pipeline, and when the weights arrive, compare missed objects, false detections, and latency on the same footage and the same hardware. That is the only comparison that reflects your real deployment.

What should our first YOLO27 test be: tiny objects, crowded scenes, or motion blur? Comment your pick.

Full breakdown: https://docs.ultralytics.com/models/yolo27

09/16/2026

Write GPU Code Once: How HIP Ports Between AMD and Nvidia

If you are maintaining one GPU codebase for AMD and another for Nvidia, HIP can remove most of that duplication, but only if you understand what portable actually means. HIP stands for Heterogeneous-computing Interface for Portability, and it is AMD's C++ runtime API and kernel language, designed to look familiar to CUDA developers. The model is very similar: include the HIP runtime header, allocate device memory with hipMalloc, move data with hipMemcpy, write a global kernel, and launch it with the same triple chevron grid and block syntax used by CUDA.

For a new project, use the HIP APIs from the start. For an existing CUDA project, start with HIPIFY, which translates names like cudaMalloc into hipMalloc and cudaMemcpy into hipMemcpy, though it is a starting point, not a one click finish, since CUDA-only libraries, inline PTX, specialized intrinsics, and hardware assumptions can still need manual work. The key build step: on an AMD system, hipcc drives AMD's clang and targets the ROCm stack, and on an Nvidia system you set HIP_PLATFORM to nvidia and hipcc drives NVCC and targets CUDA. That gives you one source codebase but two separate binaries, so HIP provides source portability, not a universal GPU executable.

To keep the source portable, avoid vendor-only code in the common path, do not hard code a warp size of 32 (use warpSize, because AMD hardware can use 32 or 64), and isolate any tuned path with HIP's AMD and Nvidia platform macros. Finally, run the same correctness test on both platforms and profile each separately, because code that compiles everywhere can still perform very differently on different hardware. The rule is simple: write the algorithm once in HIP, build it once for ROCm and once for CUDA, and validate both.

Full breakdown: https://rocm.docs.amd.com/projects/HIP/en/latest/how-to/hip_porting_guide.html

09/15/2026

How a Confusion Matrix Works (and Why Accuracy Can Lie)

A confusion matrix separates two questions: what animal is actually in a photo, and what label was predicted? For this explanation, I'll use cat and dog photos with predictions invented to illustrate the idea, and no model was run. Cat is the positive class and dog is the negative class, and those words simply identify the classes, not good or bad outcomes. The four cases are: a cat predicted as cat is a true positive, a dog predicted as cat is a false positive, a cat predicted as dog is a false negative, and a dog predicted as dog is a true negative.

Here, rows show the actual animal and columns show the prediction, with cat first on both axes, so the cat row holds true positives then false negatives, and the dog row holds false positives then true negatives. Each photo lands in exactly one cell, and you should always read the labels because another chart may arrange them differently. In a 10 photo example with 6 cats and 4 dogs, the counts are 5 true positives, 1 false negative, 2 false positives, and 2 true negatives, so the diagonal of correct predictions is 5 plus 2, which is 7 out of 10, giving 70% accuracy.

But accuracy alone can hide an important failure. In a separate thought experiment, suppose there is 1 cat and 99 dogs: predicting dog every time gives 99% accuracy while missing the only cat. The confusion matrix reveals that miss. It tells you which labels were confused, though it does not explain why.

09/11/2026

Why a Perfect Training Score Can Still Fail: Overfitting vs Underfitting

A perfect training score can still fail, and here is the intuition with a simple example. Imagine dots representing heights with small measurement errors added. We fit each model on the training dots and hold out other dots as validation data, which lets us check predictions at points the model did not train on. A straight line cannot follow the ball's rise and fall, so it misses the curved pattern even in its training data, which is underfitting. Averaging each dot's vertical distance from the prediction, the straight line is off by about 51 centimeters on training and 43 on validation.

A much more flexible curve passes through every training dot, so its training error is effectively zero, but it also follows the added noise and bends away from the real arc, and on validation its average error is about 20 centimeters. That is overfitting: fitting details of the training sample that do not carry over to new data. A smooth curve follows the rise and fall without hitting every noisy dot, with about 4 centimeters of error on training and 2 on validation, the best of the three.

These are illustrative numbers, but the lessons hold: zero training error does not establish success, and complexity alone does not establish overfitting. Choose your model using representative validation data, then evaluate the chosen model on a separate final test set, and keep that test set out of the selection process. For underfitting, try a model that can express the missing pattern, and for overfitting, try limiting unnecessary flexibility or adding more representative training examples, then check whether validation performance improves. None of these remedies is a guarantee.

Full breakdown: https://learnopencv.com/bias-variance-tradeoff-in-machine-learning/

09/11/2026

Linear Assignment: Smarter Pairings, Lower Costs

Assigning Alice and Bob to jobs X and Y isn’t just about picking the cheapest option - it’s about minimizing the total cost. Linear assignment compares complete pairings, showing how a slightly higher choice for one worker can save big overall.

From simple cost matrices to advanced computer vision 🚀, this method ensures efficient 1‑to‑1 matches. Coming soon in OpenCV with C++ and Python support!

09/10/2026

OpenAI's Astra Reached "Critical" Cyber Capability: What That Means

OpenAI's Astra broke through a browser's security and got commands running on the computer underneath, according to OpenAI's own security tests using special cybersecurity access. To understand it: when you open a website, your browser runs code from that page, but a sandbox is supposed to keep that code boxed in, like a visitor who gets into a building but not the keys to every office. In OpenAI's evaluation, Astra found previously unknown weaknesses and connected them into a working attack, and when the browser opened an HTML file, that attack escaped the sandbox and ran commands on the host.

The significant part is the connection between those weaknesses. A single flaw might only get you so far, but one weakness can open a path to another until you cross a boundary that was supposed to stop you, and Astra demonstrated that chain. OpenAI now classifies this as a critical cybersecurity capability, the first OpenAI model to reach that level, meaning that with the right tools and access it can find unknown weaknesses and build working attacks against well-protected systems without someone directing every step.

But there is another side. A security team could use that same ability to find the same path and close it before an attacker arrives, and that is valuable because a vague "this looks suspicious" leaves you with questions, while a working demonstration shows a weakness can actually be used. These results came from a special cybersecurity configuration and do not mean the regular chat version can simply break into any computer. The real shift is that AI is getting better at discovering how security measures fail, and the question is whether we can use that ability to fix weaknesses faster than attackers can exploit them.

Full breakdown: https://openai.com/index/path-to-astra/

09/10/2026

ChatGPT Image 2.5 vs Image 2: 100 Looks, One Face

One original portrait. The same 100 prompts. Two image models.

Watch 100 looks change in 60 seconds, with ChatGPT Image 2 on the left and ChatGPT Image 2.5 Flare on the right. Each look varies five elements: hats, glasses, jackets, facial hair, and shirts.

Compare how the models transform the style while preserving the face.

09/09/2026

The Real AI Battle Is Software, Not GPUs

The real battle in AI is not just GPUs, it is software, and AMD is now putting AI agents to work on the problem every CUDA alternative has to solve: developer friction. ROCm, pronounced rock-em, is AMD's open software stack for GPU computing, with runtimes, compilers, optimized math and communication libraries, profilers, and AI and HPC integrations. The production release ROCm 7.14 moves the platform to TheRock, AMD's modular build system, so instead of one monolithic stack, developers start with a lean core SDK and add only the components their workload needs.

Now AMD is adding a new layer called ROCm.AI. AMD-authored skills bring validated ROCm workflows into coding assistants such as Codex, Claude, and Cursor, so one skill can guide an LLM deployment with vLLM on AMD Instinct GPUs, and another can turn PyTorch profiler traces into performance recommendations. Underneath those agents, the new ROCm CLI provides repeatable commands for installing, inspecting, serving, updating, and generating diagnostics, ROCm Console adds local telemetry and runtime status, and Hyperloom is AMD's agentic optimizer that profiles host code and GPU kernels, finds bottlenecks, proposes changes, benchmarks them, and validates correctness.

There is an important caveat: ROCm 7.14 is production software, but the AMD Skills catalog is still a tech preview, the CLI and console are nightly builds, and several skills are coming soon, and ROCm is not a universal drop-in replacement for CUDA, since support varies and some workloads still need manual porting. Still, AMD is attacking the right bottleneck: not just how fast its GPUs run, but how quickly a developer goes from an idea to a working, optimized workload. If ROCm.AI delivers, competition in AI hardware gets much more interesting.

Full breakdown: https://www.amd.com/en/products/software/rocm/rocm-ai.html

Address

San Francisco, CA

Alerts

Be the first to know and let us send you an email when Opencv University posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Contact The School

Send a message to Opencv University:

Shortcuts

Share

Category