Algorithm to detect photo orientation

Many photographs from consumer digital cameras are of people, which could be used for orientation. Face detection is a well-studied research area. Basic face detection would give you a rectangle whose longer side should be the vertical dimension. Further, if you can detect the eyes/mouth, you should be able to pick the correct orientation of … Read more

tool to get coordinates of an image pixel [closed]

In photoshop, the information pannel give you that. I’m pretty sure it’s also possible in Gimp. Or you can make your own tool ! I made you a small example in jsfiddle : http://jsfiddle.net/zz3Rh/19/ The html : <div id=”image”>image</div> coordinates : <div id=”coordinates”>0</div>​ The css : #image{ height:350px; background:#c00;}​ The js (with jquery loaded) : … Read more

How can I enable keep-alive?

Configure Apache KeepAlive settings Open up apache’s configuration file and look for the following settings. On Centos this file is called httpd.conf and is located in /etc/httpd/conf. The following settings are noteworthy: KeepAlive: Switches KeepAlive on or off. Put in “KeepAlive on” to turn it on and “KeepAlive off” to turn it off. MaxKeepAliveRequests: The … Read more

How to reduce the number of colors in an image with OpenCV?

This subject was well covered on OpenCV 2 Computer Vision Application Programming Cookbook: Chapter 2 shows a few reduction operations, one of them demonstrated here in C++ and later in Python: #include <iostream> #include <vector> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> void colorReduce(cv::Mat& image, int div=64) { int nl = image.rows; // number of lines int nc … Read more

Draw a rectangle in Golang?

The standard Go library does not provide primitive drawing or painting capabilities. What it provides is models for colors (image/color package) and an Image interface with several implementations (image package). The blog post The Go Image package is a good introduction to this. It also provides a capability to combine images (e.g. draw them on … Read more

How to remove all lines and borders in an image while keeping text programmatically?

Since no one has posted a complete OpenCV solution, here’s a simple approach Obtain binary image. Load the image, convert to grayscale, and Otsu’s threshold Remove horizontal lines. We create a horizontal shaped kernel with cv2.getStructuringElement() then find contours and remove the lines with cv2.drawContours() Remove vertical lines. We do the same operation but with … Read more

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