Remove references to old wordpress blog

We deleted the wordpress blog before salvaging the pictures.
Only the PWM playback picture could be recovered. Remove the
references to the wordpress blog.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2019-01-17 07:54:05 +05:30
parent da70b5c067
commit 6efeee0863
4 changed files with 3 additions and 107 deletions

BIN
images/playback2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -22,4 +22,4 @@ tags: audio, PWM
<p style='text-align: justify;'>You might be wondering about the assumption I told you about, just in case you still didn't get it. The number of samples to be inserted in between will depend on the sampling rate. In my case, I used a PWM frequency of 40 KHz, so I inserted four samples in between. Refer the below figure. Depending upon the code you write and how you have to set up PWM for your processor, you might have to scale the values of the array and the bits per sample will be important for this scaling.</p>
[![](http://coherentmusings.files.wordpress.com/2012/10/playback2.jpg)](http://coherentmusings.files.wordpress.com/2012/10/playback2.jpg)
![](/images/playback2.jpg)

View File

@ -1,102 +0,0 @@
---
author: Sanchayan Maity
title: Face detection with OpenCV
tags: face detection, opencv
---
Below is the code for face detection in OpenCV.
<pre><code>
#include "opencv/cv.h"
#include "opencv/cxcore.h"
#include "opencv/highgui.h"
#include "stdio.h"
int main()
{
IplImage* frame = NULL;
const char* cascade_path = "C:\\OpenCV\\opencv\\data\\haarcascades\\haarcascade_frontalface_alt2.xml";
CvHaarClassifierCascade* hc = NULL;
CvMemStorage* storage = cvCreateMemStorage(0);
CvSize minSize = cvSize(100, 100);
CvSize maxSize = cvSize(640, 480);
CvSeq* faces = NULL;
CvCapture* input_camera = NULL;
int key = 0;
int loopCounter = 0;
hc = (CvHaarClassifierCascade*)cvLoad(cascade_path, NULL, NULL, NULL);
if (hc == NULL)
{
printf("\nLoading of classifier failed\n");
return -1;
}
input_camera = cvCaptureFromCAM(-1);
if (input_camera == NULL)
{
printf("\nCould not open camera\n");
return -1;
}
//Grabs and returns a frame from camera
frame = cvQueryFrame(input_camera);
if (frame == NULL)
{
printf("\nCould not capture frame\n");
return -1;
}
cvNamedWindow("Capturing Image ...", 0);
cvResizeWindow("Capturing Image ...",
(int) cvGetCaptureProperty(input_camera, CV_CAP_PROP_FRAME_HEIGHT),
(int) cvGetCaptureProperty(input_camera, CV_CAP_PROP_FRAME_WIDTH));
while(frame != NULL)
{
faces = cvHaarDetectObjects(frame, hc, storage, 1.2, 3, CV_HAAR_DO_CANNY_PRUNING, minSize, maxSize);
for (loopCounter = 0; loopCounter < (faces ? faces->total : 0); loopCounter++)
{
CvRect *r = (CvRect*)cvGetSeqElem(faces, loopCounter);
CvPoint pt1 = { r->x, r->y };
CvPoint pt2 = { r->x + r->width, r->y + r->height };
cvRectangle(frame, pt1, pt2, CV_RGB(0, 255, 0), 3, 4, 0);
}
//Shows a frame
cvShowImage("Capturing Image ...", frame);
// Checks if ESC is pressed and gives a delay
// so that the frame can be displayed properly
key = cvWaitKey(1);
if (key == 27)        // ESC key
{
break;
}
//Grabs and returns the next frame
frame = cvQueryFrame(input_camera);
}
//cvReleaseImage( &frame );
cvReleaseCapture(&input_camera);
cvReleaseMemStorage( &storage );
cvReleaseHaarClassifierCascade( &hc );
//Destroy the window
cvDestroyWindow("Capturing Image ...");
return 0;
}</code></pre>
<p style='text-align: justify;'>I have tested the above code on a NVidia Tegra2 with Toradex Colibri T20 module and also on my laptop. Works, but there is a bug it seems. The program crashes if I enable the cvReleaseImage() line. Not an OpenCV expert, will have to really study the functions properly before playing around I guess. Will update this as soon as i found out.</p>
<p style='text-align: justify;'>I have not explained the OpenCV installation procedure for windows as it is already documented on the OpenCV website.</p>
<p style='text-align: justify;'>For using with Beagleboard you can refer to a previous article of mine</p>
[http://coherentmusings.wordpress.com/2012/06/24/getting-started-with-opencv-on-beagleboard-xm/](http://coherentmusings.wordpress.com/2012/06/24/getting-started-with-opencv-on-beagleboard-xm/).
<p style='text-align: justify;'>You can also use OpenCV with embedded Linux if you use Buildroot or OpenEmbedded for building your image.</p>

View File

@ -6,7 +6,7 @@ tags: device driver, sysfs
<p style='text-align: justify;'>A month or so back I had given an example of how to add support for a device using the platform bus framework, which as such mainly showed how exactly platform framework worked and what it was used for. In the driver I wrote, I provided access to the required values using the ioctl calls. The ioctl() calls are not a recommended way of doing this. These days drivers provide the data and control to the user space through the **sysfs** interface. As the **Linux Kernel Development** book mentions "**The sysfs file system is currently the place for implementing functionality previously reserved for ioctl() calls on device nodes or the procfs filesystem**". This post will show how to make possible what we tried to achieve in the </p>
[http://coherentmusings.wordpress.com/2013/12/13/how-to-write-a-platform-devicedriver-adc-driver-using-wm97xx-codec/](http://coherentmusings.wordpress.com/2013/12/13/how-to-write-a-platform-devicedriver-adc-driver-using-wm97xx-codec/)
[Write a platform device ADC driver using wm97xx codec](https://sanchayanmaity.gitlab.io/2013-12-13-how-to-write-a-platform-devicedriver-adc-driver-using-wm97xx-codec/)
<p style='text-align: justify;'>article in a much easier way using the sysfs interface. Please refer that article before reading further.</p>
@ -92,9 +92,7 @@ device_remove_file(wm->dev, &dev_attr_adc_channel3);
device_remove_file(wm->dev, &dev_attr_adc_channel4);
```
<p style='text-align: justify;'>After doing the above changes, the device attributes which we added show up in the sysfs tree, which can be used to get the ADC values, as shown in the below picture.</p>
[![sysfs](http://coherentmusings.files.wordpress.com/2014/02/sysfs1.png)](http://coherentmusings.files.wordpress.com/2014/02/sysfs1.png)
<p style='text-align: justify;'>After doing the above changes, the device attributes which we added show up in the sysfs tree, which can be used to get the ADC values.</p>
<p style='text-align: justify;'>If you compare this to what we tried to do previously, you can see how easy it is to get the ADC values as it allows a simple command like **cat **to access the value. Of course, you could also access the value in C code as well. Things will not always be simple like this. Here we already had a core driver, which allowed us to just add the necessary changes and get what we wanted.</p>