How to connect broken lines in a binary image using Python/Opencv

MikeE‘s answer is quite good: using dilation and erosion morphological operations can help a lot in this context. I want to suggest a little improvement, taking advantage of the specific structure of the image at hand. Instead of using dilation/erosion with a general kernel, I suggest using a horizontal kernel that will connect the endpoints … Read more

What is the difference between Keras model.evaluate() and model.predict()?

The model.evaluate function predicts the output for the given input and then computes the metrics function specified in the model.compile and based on y_true and y_pred and returns the computed metric value as the output. The model.predict just returns back the y_pred So if you use model.predict and then compute the metrics yourself, the computed … Read more

Overlapping sliding window over an image using blockproc or im2col?

OK, this is quite a complex question. I’ll try and break this up into separate parts and will answer each question separately. Question #1 blockproc can be used to implement my function on a sliding window using the BorderSize and TrimBorder arguments. B = blockproc(A,[64,64],fun,’BorderSize’,[5,5], ‘TrimBorder’, ‘false’); I realize that this creates a block of … Read more

What is “semantic segmentation” compared to “segmentation” and “scene labeling”?

“segmentation” is a partition of an image into several “coherent” parts, but without any attempt at understanding what these parts represent. One of the most famous works (but definitely not the first) is Shi and Malik “Normalized Cuts and Image Segmentation” PAMI 2000. These works attempt to define “coherence” in terms of low-level cues such … Read more

Image segmentation based on edge pixel map [closed]

Very nice work on boundary detection. I used to work on similar segmentation problems. Theory: Once you obtained your edge map where e(i,j) indicates the “edge-iness” degree of pixel i,j you would like a segmentation of the image that would respect the edge map as possible. In order to formulate this “respect the edge map” … Read more

How to make the blackboard text appear clearer using MATLAB?

When it comes to identifying text in images you better use Stroke Width Transform. Here’s a little result I obtained on your image (the basic transform + connected component w/o filtering): My mex implementation based on code from here #include “mex.h” #include <vector> #include <map> #include <set> #include <algorithm> #include <math.h> using namespace std; #define … Read more

How to define the markers for Watershed in OpenCV?

First of all: the function minMaxLoc finds only the global minimum and global maximum for a given input, so it is mostly useless for determining regional minima and/or regional maxima. But your idea is right, extracting markers based on regional minima/maxima for performing a Watershed Transform based on markers is totally fine. Let me try … Read more