Menu
  • HOME
  • TAGS

MATLAB Auto Crop

matlab,image-processing,crop,bounding-box

Following the answer of Shai, I present a way to circumvent regionprops (image processing toolbox) just based on find on the black-white image. % load img = im2double(imread('http://i.stack.imgur.com/ZuiEt.jpg')); % black-white image by threshold on check how far each pixel from "white" bw = sum((1-img).^2, 3) > .5; % show bw...

MATLAB Boundingbox around object detected with Eigen Value Algorithm

matlab,bounding-box,object-detection

your output corner is an object for storing corner points, use corner.Location to get an M-by-2 array of [x y] point coordinate.

Displaying tracks using MATLAB

matlab,computer-vision,bounding-box,matlab-cvst

You can use the insertMarker function in the Computer Vision System Toolbox to mark the centers of the bounding boxes.

How can I enclose some XML elements in a bounding box?

xml,android-layout,android-xml,rectangles,bounding-box

Use a vertical LinearLayout to enclose your CheckBoxes and another one to enclose your RadioButtons and assign them an xml drawable as the background (you could alternatively use a 9 patch, if you feel more comfortable with): The two extra LinearLayouts are children of the outer container. /res/drawable/box.xml (self contained...

Matlab vision.blobAnalysis bbox area-center usage

matlab,center,area,bounding-box,matlab-cvst

If you set AreaOutputPort and CentroidOutputPort to true, you will get three outputs instead of one. Instead of bbox = step(blobAnalysis, filteredForeground); use [areas, centroids, bbox] = step(blobAnalysis, filteredForeground); The way you currently have it bbox ends up being a 1-D array containing the areas, which is why insertShape throws...

Check if cvRect is within cvMat

c++,opencv,bounding-box

Like the error says, your x, y, w and h are not allowed to be negative. Try to add a std::max() and std::min(): #include <algorithm> // std::max && std::min int Z = 10; int x = std::max<int>(0, appRect.x-Z); int y = std::max<int>(0, appRect.y-Z); int w = std::min<int>(mat.cols - x, appRect.width+2*Z);...

Mapping bounding box to the original image in Matlab

matlab,matlab-cvst,bounding-box

You simply add the coordinates of the top-left corner of the cropped region to the top-left corners of the detected bounding boxes. Also, in the latest version of MATLAB vision.CascadeObjectDetector supports passing in the region of interest where you want to detect objects, so that you do not need to...

Equaling bounding box to another bounding box : Opencv , Android

java,android,sorting,opencv,bounding-box

For the swop part use the f.f.g code: Collections.swap (contourRects, j, j + 1); Instead of: temp = contourRects.get(j); contourRects(j) = contourRects.get(j+1); contourRects.get(j+1) = temp; ...

D3js : How to get the real bounding box of features crossing the anti-meridian?

d3.js,bounding-box,d3.geo

You should use d3.geo.bounds for this, as you need bounding box in spherical coordinates. (Using d3.geo.path with the identity function as a projection doesn’t work because d3.geo.path can only compute a bounding box in Cartesian coordinates.) See Jason Davies’ Geographic Bounding Boxes page for details....

How can rectangular bounding box from regionprops(Image,'BoundingBox') in Matlab?

matlab,image-processing,computer-vision,matlab-cvst,bounding-box

Your problem actually isn't drawing the bounding box - it's locating the person inside the image, which you haven't quite done properly. If you don't do this correctly, then you won't be able place the correct bounding box around the person. This is what I have done to locate the...

SFML Bounding Box Collision Detection

c++,collision-detection,sfml,bounding-box

Hazarding a guess, I'd say that rotation of the object is the culprit, as rotation has the unfortunate effect of expanding the bounds of an object. The bounding rectangle after rotation is still in the x-y plane determined by the screen, but encompasses the object post-rotation. As illustration, look at...

D3 force directed layout: bounding box

javascript,d3.js,force-layout,bounding-box,directed-graph

I found out how it goes. If anybody wants to add a bounding box to this mobile-patent-suits example (http://bl.ocks.org/mbostock/1153292), this might be helpful: function tick() { //circle.attr("transform", transform); //no need for this anymore circle.attr("cx", function(d) { return d.x = Math.max(8, Math.min(300 - 8, d.x)); }) .attr("cy", function(d) { return d.y...

Extracting text OpenCV

c++,opencv,image-processing,text,bounding-box

You can detect text by finding close edge elements (inspired from a LPD): #include "opencv2/opencv.hpp" std::vector<cv::Rect> detectLetters(cv::Mat img) { std::vector<cv::Rect> boundRect; cv::Mat img_gray, img_sobel, img_threshold, element; cvtColor(img, img_gray, CV_BGR2GRAY); cv::Sobel(img_gray, img_sobel, CV_8U, 1, 0, 3, 1, 0, cv::BORDER_DEFAULT); cv::threshold(img_sobel, img_threshold, 0, 255, CV_THRESH_OTSU+CV_THRESH_BINARY); element = getStructuringElement(cv::MORPH_RECT, cv::Size(17, 3) ); cv::morphologyEx(img_threshold,...

Why does getBoundingClientRect only work locally?

javascript,jquery,html,css,bounding-box

No, the rotated bit within c extends out of c, without changing its size. This should make it a bit clearer: var bbox_a = document.getElementById("a").getBoundingClientRect(); snippet.log("a: " + bbox_a.width + "x" + bbox_a.height); var bbox_b = document.getElementById("b").getBoundingClientRect(); snippet.log("b: " + bbox_b.width + "x" + bbox_b.height); var bbox_c = document.getElementById("c").getBoundingClientRect(); snippet.log("c:...

Bounding Rectangles under Sprites HTML5 Canvas

javascript,html5-canvas,bounding-box

Collision detection between rotated rectangles is mathematically complicated and comes in several flavors: Detect if the 2 rotated rectangles are intersecting (colliding) To detect if 2 rotated rectangles are colliding (but not detect where they are colliding), you can use the Separating Axis Theorm. A nice explanation is here: http://gamedevelopment.tutsplus.com/tutorials/collision-detection-using-the-separating-axis-theorem--gamedev-169...

Generating a bounding box around a fragmented silhouette in matlab

matlab,image-processing,computer-vision,bounding-box

Here is something to get you going with the image you posted. I used a line structuring element with an angle to dilate the image and amplify the signal from the small white chunks at the left of the silhouette. Then using regionprops its easier to identify objects individually and...

How to crop pdf using Ghostscript (without entering manually Bounding Box)

pdf,crop,ghostscript,bounding-box

What you need is called command substitution. Please refer to help by 'for /?' command For simplicity I have separated answer into two files First file (getbb.bat) get bounding box @echo off "C:\Program Files\gs\gs9.02\bin\gswin64c.exe"^ -o nul -sDEVICE=bbox %1 2>&1 | find "ResBoundingBox" Second file (replacebb.bat) @echo off for /f "tokens=2...

oriented box intersection in threeJS

three.js,intersection,bounding-box

If you're looking to roll your own, I'd recommend reading Separating Axis Theorem for Oriented Bounding Boxes by Johnny Huynh. Here is a collision detection method given two orientated bounding boxes I made for a game I was working on. It isn't in ThreeJS but it should be fairly straight...

Oriented Bounding Box is Misshapen and the Wrong Size in OpenGL

c++,opengl,bounding-box

The code looks right (I haven't checked all the functions like matrixmult and like that but I assume you have tested and checked them). Problem: you have a small misunderstanding of what are you doing there. So, to help you a bit, but not code your coursework by myself, as...