How do I crop an image using C#?

Check out this link: http://www.switchonthecode.com/tutorials/csharp-tutorial-image-editing-saving-cropping-and-resizing private static Image cropImage(Image img, Rectangle cropArea) { Bitmap bmpImage = new Bitmap(img); return bmpImage.Clone(cropArea, bmpImage.PixelFormat); }

What is the best java image processing library/approach? [closed]

I know this question is quite old, but as new software comes out it does help to get some new links to projects that might be interesting for folks. imgscalr is pure-Java image resizing (and simple ops like padding, cropping, rotating, brighten/dimming, etc.) library that is painfully simple to use – a single class consists … Read more

Representing and solving a maze given an image

Here is a solution. Convert image to grayscale (not yet binary), adjusting weights for the colors so that final grayscale image is approximately uniform. You can do it simply by controlling sliders in Photoshop in Image -> Adjustments -> Black & White. Convert image to binary by setting appropriate threshold in Photoshop in Image -> … Read more

Recommendation for compressing JPG files with ImageMagick

I use always: quality in 85 progressive (comprobed compression) a very tiny gausssian blur to optimize the size (0.05 or 0.5 of radius) depends on the quality and size of the picture, this notably optimizes the size of the jpeg. Strip any comment or EXIF metadata in imagemagick should be convert -strip -interlace Plane -gaussian-blur … Read more

How to detect a Christmas Tree?

I have an approach which I think is interesting and a bit different from the rest. The main difference in my approach, compared to some of the others, is in how the image segmentation step is performed–I used the DBSCAN clustering algorithm from Python’s scikit-learn; it’s optimized for finding somewhat amorphous shapes that may not … Read more

Peak detection in a 2D array

I detected the peaks using a local maximum filter. Here is the result on your first dataset of 4 paws: I also ran it on the second dataset of 9 paws and it worked as well. Here is how you do it: import numpy as np from scipy.ndimage.filters import maximum_filter from scipy.ndimage.morphology import generate_binary_structure, binary_erosion … Read more

How do I find Waldo with Mathematica?

I’ve found Waldo! How I’ve done it First, I’m filtering out all colours that aren’t red waldo = Import[“http://www.findwaldo.com/fankit/graphics/IntlManOfLiterature/Scenes/DepartmentStore.jpg”]; red = Fold[ImageSubtract, #[[1]], Rest[#]] &@ColorSeparate[waldo]; Next, I’m calculating the correlation of this image with a simple black and white pattern to find the red and white transitions in the shirt. corr = ImageCorrelate[red, Image@Join[ConstantArray[1, {2, … Read more

Image Processing: Algorithm Improvement for ‘Coca-Cola Can’ Recognition

An alternative approach would be to extract features (keypoints) using the scale-invariant feature transform (SIFT) or Speeded Up Robust Features (SURF). You can find a nice OpenCV code example in Java, C++, and Python on this page: Features2D + Homography to find a known object Both algorithms are invariant to scaling and rotation. Since they … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)