This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using OpenCV = Emgu.CV; | |
public class Utilities{ | |
public static MathNet.Numerics.LinearAlgebra.Matrix<double>[] LoadImageMatrix(string path) | |
{ | |
OpenCV.Mat mat = OpenCV.CvInvoke.Imread(path, OpenCV.CvEnum.ImreadModes.AnyColor); | |
OpenCV.Image<OpenCV.Structure.Bgr, double> image = mat.ToImage<OpenCV.Structure.Bgr, double>(); | |
OpenCV.Image<OpenCV.Structure.Gray, double> blue = image[0]; | |
OpenCV.Image<OpenCV.Structure.Gray, double> green = image[1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get image dimensions | |
$image_width = imagesx($image); | |
$image_height = imagesy($image); | |
$text_bound = imageftbbox($font_size, $angle, $font, $text); | |
//Get the text upper, lower, left and right corner bounds | |
$lower_left_x = $text_bound[0]; | |
$lower_left_y = $text_bound[1]; | |
$lower_right_x = $text_bound[2]; |