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
{ | |
"metadata": { | |
"name": "PyMADlib" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
{ | |
"metadata": { | |
"name": "Python awesomeness ;-)" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:50dec51e2d2443c96fa76c4b031cb21c3753b9100182a59e6b2105e0c2c2fc79" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
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
/* | |
* Gautam Muralidhar and Srivatsan Ramanujam, 28 Oct 2014 | |
* C++ functions compiled into dynamic library to be invoked from PL/Python via ctypes. | |
* Canny Edge Detection from OpenCV. | |
*/ | |
#include "opencv2/opencv.hpp" | |
#include "opencv2/imgproc/imgproc.hpp" | |
#include <stdio.h> | |
#include <string.h> | |
#include <iostream> |
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
-------------------------------------------------------------------------------------------------------------- | |
-- Gautam Muralidhar, Srivatsan Ramanujam, Oct-2014 | |
-- PL/Python UDF, which calls the native Canny edge detection application | |
-- Input: the raw image byte stream encoded as a comma-separated string and stored in a column in a HAWQ table | |
-- Output: a composite type as defined in Figure 5. | |
-------------------------------------------------------------------------------------------------------------- | |
CREATE OR REPLACE FUNCTION canny_edge_detect(img varchar) | |
RETURNS canny_output_type |
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
/** | |
* Gautam Muralidhar,Srivatsan Ramanujam Oct 2014 | |
* PL/C function for invoking Canny's Edge Detection from OpenCV | |
**/ | |
extern "C" { | |
#include <postgres.h> | |
#include <fmgr.h> | |
#include <utils/array.h> | |
#include <utils/builtins.h> | |
#include <catalog/pg_type.h> |
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
/** | |
* Gautam Muralidhar, Nov 2014 | |
* Internal C++ functions for Canny Edge Detection. | |
* | |
**/ | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include "opencv2/opencv.hpp" | |
#include "opencv2/imgproc/imgproc.hpp" |
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
/** | |
* Gautam Muralidhar, Srivatsan Ramanujam, Nov 2014 | |
* PL/C UDFs to invoke Edge Detection | |
*/ | |
create or replace function CannyEdgeDetectPLC(varchar) | |
returns int[] | |
as | |
'/usr/local/lib/ds/canny_plc.so', 'canny_plc' | |
language C strict immutable; |
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
/** | |
* Gautam Muralidhar, Srivatsan Ramanujam, Nov-2014 | |
* External Table defs. | |
**/ | |
create external table ocv.src_image_ext | |
( | |
img_name varchar, | |
img varchar | |
) | |
LOCATION('pxf://hdm1:50070/user/user-name/opencvexample/imgseqfile/part-r-00000?Profile=HdfsTextSimple') |
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
-- Define a type to hold [tweet_id, token_index, token, tag] items | |
DROP TYPE IF EXISTS token_tag; | |
CREATE TYPE token_tag | |
AS | |
( | |
indx int, | |
token text, | |
tag text | |
); |
OlderNewer