Connected-component labeling with ImageMagick

Yes, it is now possible with ImageMagick 6.8.9-10 and newer, see here. So, if we start with this image: we can get the components labelled and also the bounding boxes, centroids and other statistics for each blob or component like this: convert input.png \ -colorspace gray -negate -threshold 10% \ -define connected-components:verbose=true \ -define connected-components:area-threshold=100 … 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

Google AJAX API – How do I get more than 4 Results?

I believe the only way to do that is to make multiple calls to the webservice specifying the ‘start’ parameter. http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=Apple+Cake&start=4 The start parameter is the 0-based index into the search results. So in this example, it would return images 4..7. You can also add the parameter rsz=[1-8]. The default value is 4. That’s why … Read more

How to render a scaled SVG to a QImage?

Just give your QImage the desired size. The SVG renderer will scale to fit the whole image. #include <QApplication> #include <QSvgRenderer> #include <QPainter> #include <QImage> // In your .pro file: // QT += svg int main(int argc, char **argv) { // A QApplication instance is necessary if fonts are used in the SVG QApplication app(argc, … Read more

How to use Image component in Next.js with unknown width and height

Yeah, you could use it with the layout=fill option you mentioned. On this case, you’re gonna need to set an “aspect ratio” for your images <div style={{ position: “relative”, width: “100%”, paddingBottom: “20%” }} > <Image alt=”Image Alt” src=”/image.jpg” layout=”fill” objectFit=”contain” // Scale your image down to fit into the container /> </div> You can … Read more