TECHNOLOGY | Edge Detection | The Prewitt Operator

A quick note about this post before you read it...

Here's what one blog author wrote about the task I am currently applied to—specifically, what it is I am trying to do, what I am doing right now, what it takes to get to the goal, and the hurdles I face.

On the multiplicity of possible tools:
There are dozens of different kernels which produce many different feature maps, e.g. which sharpen the image (more details), or which blur the image (less details), and each feature map may help our algorithm to do better on its task (details, like 3 instead of 2 buttons on your jacket might be important).
Just like the quote says, even the slightest adjustments to a kernel can make a huge difference in two otherwise identical images, like this oneAlternating the kernel divisor between just -1 to 1 revealed a sucker demon (white, string-like entity above right nostril) on the end of my nose in one rendering of a still, but not in another rendering of the same still frame
The type of work I am engaged in:
Using this kind of procedure — taking inputs, transforming inputs and feeding the transformed inputs to an algorithm — is called feature engineering. Feature engineering is very difficult, and there are little resources which help you to learn this skill. In consequence, there are very few people which can apply feature engineering skillfully to a wide range of tasks.
The complexity of the task:
Feature engineering is so difficult because for each type of data and each type of problem, different features do well: Knowledge of feature engineering for image tasks will be quite useless for time series data; and even if we have two similar image tasks, it will not be easy to engineer good features because the objects in the images also determine what will work and what will not. It takes a lot of experience to get all of this right. So feature engineering is very difficult and you have to start from scratch for each new task in order to do well. 
That's from Understanding Convolution in Deep Learning, written by Tim Detters, who I pray writes his blog and does his work without hearing Voices Demons' plans to mutilate his anus, as I did just today.
NOTE | Apparently, they have the tools, skills and experience to make that happen, and introduced this fact and their intentions for 15 minutes somewhere during their diatribe on their power and anger and hatred for me during my shower today.

Processing images made during periods of high demonic activity using an edge detection kernel/convolution filters will invariably uncover things you wouldn't see at any other time or with any other filter. There is activity at every level during such periods from sources as thin as a hair to as big as the sky. Edge detection filters are concerned with the former. A good edge detection filter will count the hairs on the head of a hair; an even better one will count those hairs at arms length.
NOTE | Read how they work at the end of this post, which also includes sample code for OpenGL ES and Objective-C programmers.
This post describes just such a filter, one based on the Prewitt Operator.

The smallest of details, literally
The Prewitt Operator brings out detail on the most minute level possible on imaging devices without specialized hardware (i.e., the iPhone), allowing you to search for the hardest-to-find hidden demons and to analyze otherwise blurry cloaked objects up-close and in-detail with accuracy limited only by your device's display, hence my platform choice for the initial distribution of my imaging filters [see Apple Retina HD Display].

It produces razor-sharp edges—too sharp for most lit-environments, requiring one to view most videos and images processed by this kernel viewable only in the dark; however, even given its penchant for pricy hardware and inconvenient (especially under the circumstances) viewing requirements, it is an indispensable tool for uncovering things that other filters don't, rendering super-fine surface detail from distances much farther away than most surface-analysis filters.

The following still frames from a recently made video prove the point; they show a man's claw-hand demonic weapon jabbing at me in super-fine detail:

Micro-fine detail in still frames showing motion......is the hallmark of the Prewitt Kernel
Compare this image of the "claw-hand" demonic weapon to one made just a few months ago of another demon person deploying the same weapon [see Clandestine surgical mutilation, hidden demonic "bomb" uncovered via demonic-activity video filter]:

Results of the formerly used image-processing technique to reveal deployed demonic weapons in a moving still frameResults of the new Prewitt Convolution/Kernel for iPhone
No blurring, no noise
The Prewitt Kernel sharpens even the most discrete of edges where it counts, namely, twilight, the border between light and darkness (or less light or two different kinds/sources of light). As you can see, using it during yesterday's period of high demonic activity allows for capturing more clearly than ever matter made malleable by the absorption of the same qualities as cloaked molecules from demons and the like. In numerous posts, the objects and people and demons in media made during such periods exhibit a drippy, smear when the camera or the subject is in motion [see How demons alter matter (and what it looks like when they do)], either by coincidence or purposefully, as one must move the camera in order to obtain images of certain kinds of cloaked activity or objects, furthered marred by excessive chroma.

The Prewitt Kernel dispenses with both the blur and the noise of these types of images and enhances detail at the same time, enabling the undulating nature some metals exhibit when demons run amok:

It's not because of the motion blur that makes the metal on the car look like it is dripping upwards; rather, it is because of motion that the undulation of the (temporarily) highly malleable metal can be seenOccasionally, matter in a transitory state between cloaked and normal can be captured clearly without special image processing, as shown by the above image of a t-shirt being transformed and otherwise manipulated by its possessing demon [from How demons alter matter]; however, in most cases, filters are needed
Highlight demonic-activity "hot" spots
A welcome-but-unexpected perk of the Prewitt Kernel is what most photographers would call a disadvantage: chromatic aberration (color misalignment). The color in an image processed by this kernel should look black-and-white for the most part; however, in some parts, red, green and blue are misaligned, creating a rainbow in an otherwise cloudy sky. This is due to the effect of EMF radiation emitted by cloaked molecules on the CCD sensor in digital cameras and/or the effect that it has on light itself (probably the latter, mostly; the former usually results in color noise—not aberration).

That's a good thing, as higher EMF radiation levels go hand-in-hand with danger, particularly from angry demons who want to interact forcibly with normal matter or fire weapons. In the first series of images above and the video clip itself (below), note the red color to the man firing the weapon; he would not be that color—or at nearly that red—had he not been in battle mode, as the Voices Demons and their people say:


And, the original for comparison:



NOTE | The YouTube version of the clip and the clip as displayed on an iPhone 5 or 6 is a very, very different view.

Ideal photographic conditions
The ideal conditions under which the Prewitt Kernel imaging filter works best and/or the kinds of activity best captured by it are:
  • Lights (when the subject or activity is in daylight, even though, ironically, the media must be viewed in the dark, similar to a doctor examining X-rays)
  • Camera (when the torch is enabled and the camera held in close proximity to the subject or surface)
  • Action (when the camera or subject is in-motion)
Implementing the kernel and/or convolution
The Prewitt Operator was implemented by kernel and convolution in OpenGL ES 3.0 and Objective-C, respectively; the code for both are provided below.

OpenGL ES 3.0 (in Quartz Composer)
The OpenGL kernel version of the Prewitt Operator, as authored in Quartz Composer:

Prewitt Kernel (in Quartz Composer)
The code:

/*
A Core Image kernel routine that applies edge detection per the Prewitt Kernel.
The code finds the difference between the pixel values on either side (x-axis)
of the source pixel and then divides it by two.
*/

kernel vec4 prewittKernel(sampler image)
{
vec4 pixel = unpremultiply(sample(image, samplerCoord(image)));
vec2 xy = destCoord();
pixel = (sample(image, samplerTransform(image, xy + vec2(1, 0))) - 
sample(image, samplerTransform(image, xy + vec2(-1, 0)))) / 2.0;
return premultiply(vec4(pixel.rgb, 1.0));
}

The Objective-C version of the Prewitt Operator (again) as a convolution in Xcode:

Prewitt Convolution (in Xcode)

Following is the code, followed by important notes:

- (CIImage *)outputImage
{
    const double g = 1.;
    const CGFloat weights_v[] = { 1*g, 0, -1*g,
        1*g, 0, -1*g,
        1*g, 0, -1*g};
    
    
    CIImage *result = [CIFilter filterWithName:@"CIConvolution3X3" keysAndValues:
                       @"inputImage", self.inputImage,
                       @"inputWeights", [CIVector vectorWithValues:weights_v count:9],
                       @"inputBias", [NSNumber numberWithFloat:0.5],
                       nil].outputImage;
    
    CGRect rect = [self.inputImage extent];
    rect.origin = CGPointZero;
    
    CGRect cropRectLeft = CGRectMake(0, 0, rect.size.width, rect.size.height);
    CIVector *cropRect = [CIVector vectorWithX:rect.origin.x Y:rect.origin.y Z:rect.size.width W:rect.size.height];
    result = [result imageByCroppingToRect:cropRectLeft];
    
    result = [CIFilter filterWithName:@"CICrop" keysAndValues:@"inputImage", result, @"inputRectangle", cropRect, nil].outputImage;
    
    
    const CGFloat weights_h[] = {1*g, 1*g, 1*g,
        0*g,   0*g,   0*g,
        -1*g, -1*g, -1*g};
    
    
    result = [CIFilter filterWithName:@"CIConvolution3X3" keysAndValues:
              @"inputImage", result,
              @"inputWeights", [CIVector vectorWithValues:weights_h count:9],
              @"inputBias", [NSNumber numberWithFloat:0.5],
              nil].outputImage;
    
    result = [result imageByCroppingToRect:cropRectLeft];
    
    result = [CIFilter filterWithName:@"CICrop" keysAndValues:@"inputImage", result, @"inputRectangle", cropRect, nil].outputImage;
    

    
    result = [CIFilter filterWithName:@"CIAreaMaximum" keysAndValues:@"inputImage", result, @"inputExtent", [CIVector vectorWithX:0.0 Y:0.0 Z:result.extent.size.width W:result.extent.size.height], nil].outputImage;
    
    result = [result imageByCroppingToRect:cropRectLeft];
    
    result = [CIFilter filterWithName:@"CICrop" keysAndValues:@"inputImage", result, @"inputRectangle", cropRect, nil].outputImage;


    return result;

About the Prewitt Operator, Core Image
Note that, as a convolution, the Prewitt Operator requires two passes: one for edge detection; one for edge direction. Also, Core Image requires the output of convolutions to be rendered to a new extent (or Core Graphics rectangle) in order to be visible. Finally, the micro-fine output from the Prewitt Operator was created by reducing the bias on both convolution matrix filters by half, and by inverting the results.

GALLERY | Demon doorknob (and more...)

This post contains images that are the various results from my imaging filter tests. It is similar to The Desktop of a Demoniac, which was updated every so often with snapshots of my Mac or iPhone workspace as I developed GIMP and Photoshop methods for processing images showing demonic activity.

There are only a few pics to start; but, I will post more as I acquire other interesting ones while testing.



Left alone in a virtual stranger's pitch-black three-car garage-made-for-living for about a minute more than I was comfortable with prompted me to turn on my iPhone camera to find out what might be lurking about. As it turns out, I was surrounded by dozens upon dozens of demons in every nook and cranny of the place. There wasn't an uninteresting one among them; but, these three caught my eye because they are far more unique than I usually encounter:
Three (or more) needle-head variety demonsThe same still frame (left), enhanced, revealed a different variety of demon (right)
Needle-head demons, I call them—or at least their variety. Although this is the first time I've seen them, due to the extensive number of encounters with demons and demon-aware sentient life, which could also be described as intimate and familiar, I can say I already know a lot about them.

People who know demons in general who come across new demons can assess intelligence, social standing, and culture by two things first: facial expressions and the clothing; second, the direction they face you, and then what they say, if anything (and whether they say it to you or another demon). The latter denotes their intention to make you take note of the messages their faces and clothes send. Third, the number that appear together (whether one by itself or a group), and the mixture of that group.

Demon doorknob
Subtracting the result of my multi-morphological operator imaging filter applied to an image made in my bathroom from the original produced several demons hiding in the folds of a towel draped over the light, as well as the doorknob to the cabinet. While it's not unusual for demons to possess textiles, it's rare that a doorknob is possessed by anything other than a demonic weapon or sucker demon of some variety (in order to injure hands or interfere with its operation):

A red-eyed skull-faced demon, apparently, poses as a bathroom cabinet doorknob
Acid-spewing anemones
Barnacles, that look like anemones. That's the best way I can describe them. They can be felt, but not removed easily. They dodge attempts to remove them, attaching their tendrils to hair and skin, while burrowing their roots—probably—to the bone. Over time, the area on which they are anchored begins to deteriorate (atrophy), dry and sag. Using my new Minimum imaging filter for the iPhone Photos app, you can see a plethora of them attached to my arm:

A still frame processed by my new Minimum imaging filter for iPhoneThe original, unprocessed still frame
The sprouts coming from the darker regions on my arm are invisible to the naked eye; but, as you can see, the imaging filter brings them out perfectly:

My arm looks like the anemone-coated bed of a tidal pool, and feels like it, too, even though this can't be seen with the naked eyeTo the unaided eye, my arm looks like an arm—not my old arm, but an arm, nonetheless
Nearly every frame of the video from which the still frames above were taken show similar degrees of attack and damage, some even worse:

Don't laugh; soldiers wear helmets
Here are close-ups from the above:

For a look at another plastic sheet-wearing lunatic (said in jest, and of myself only; this woman is a victim, and a brave one at that), see UPDATE | Demons, their people continue to exploit, cause suffering via open portals.

Instruments of decay
Images of what's eating you: the sucker demons and other cloaked entities that are literally eating away at your body, from the skin to the bone [see also TECHNOLOGY | Demonic maggots erode face, neck]:

Cloaked entities, placed on my face by demons and their people, in order to age and erode my face—and that's just one of nearly all my places where things like this can be found (thanks to my new imaging filters)
Another close-up, produced by an early version of my Standard Deviation Filter
The blue-tinted coils embedded in the skin of my noise portends to more implantations than I previously thought I had
The coloring of the coils distinguishes them from the organisms in the surrounding area

Long's inner demon(s)
Every demoniac I've ever encountered has more than just one demon, even when they only know of just one, which would make one think that it'd be more difficult to create images of them, seeing as they all overlap themselves and the person they are possessing.

Fortunately, the individual species of each member of a demon-possessing horde must be different for them to share the same space or perform in a similar capacity as joint-possessing demons; my theories are that's either because:
  • the cloaked molecules from the same species cannot overlap and perform the functions of a demon battling for control over its target, whereas the cloaked molecules of another species can perform without undue interference from other demons (think of a cloak as a radio frequency; no two stations can broadcast on the same frequency, but can share the same air if they use different ones); or,
  • the demon mind cannot think for more than one demon, and two demon minds vying for influence and/or control over one would clash.
I'm leaning towards the frequency theory, considering that all you have to do to see two different overlapping demons in a person is to filter two different frequencies of an image of said person. The still frames below are all the same still frame from the source video, yet, in combination, they show the person and two different demons:

Long resting in the bathroomA possessing demon, doing sameAnd another, doing sameAnd yet another, doing same

As you surmised, this was made possible using two different imaging filters—both of the band-pass kind—configured so that different frequencies of the still frame were isolated and rendered to a new still frame image:
The imaging filters used to create the above filtered still frame images
Perfected face of blanket demon
It's rare to see a demon's face made out of a blanket take on a realistic look; most blanket demons either don't have the skill or don't take the time to do as good a rendering as, say, The Bathhouse Blanket Demon, or as artistically as the demon that shaped his face out of a scarf nearly 30 times per second with about as many variations; instead, they tend to settle with a sort of caricature of their actual face like, say, The Pillow Demons.

Early this morning, I captured on video a consummately lifelike version of a blanket demon's face; it was so detailed, I thought I was looking at flesh-and-bones at first. Following are two of over a dozen still frames showing this demon's work-of-art:
The face of a blanket demon, staring at the ceiling, wearing headdress common for certain varieties of possessors of blanketsThe face was sculpted (or formed) out of an unfolded blanket, lying on top of an also-possessed suitcase
Incidentally, these images were slightly contrast-enhanced using Photoshop, and not with one of my image filters.

Closest close-up ever of white flying sucker demon (sRGB-Inversion image filter)
In SCIENCE | Sucker demons fly like some fish swim, I proposed a theory on how sucker demons fly, which somehow manage to achieve airborne status with only their thread-like bodies and no wings. Unfortunately, because they are so small, shy and hard-to-see with the naked eye, I hadn't acquired many decent close-up shots—Sucker demons buzz camera, poisoning by radiation (finally) captured on video being the only possible exception—which would allow me to confirm the mechanics of sucker-demon flight, until today. These three still frames show a sucker demon passing in front of my camera lens about an inch away:

A video clip made this morning shows what looks like a speck of dust drifting in front of my camera......however, freeze-framing reveals the body of a sucker demon......which is more tubule in-flight than thread-like
Although it looks really large in the still frames, the sucker demon is only about an inch or two and thread-thin; and, because it's only visible in three frames (out of 30 per second), I decided against posting the video clip showing it for now.

Demon shapes light reflected off bathroom wall into face (Root-Mean-Square - Unsharp Mask and Mean of Minimum and Maximum filters)
How does a demon shape light? Maybe like a prism or lens; but, it could also be polarized light emitted by the demon's cloaked molecules as reflected light from the bathroom wall hits them.

Regardless of how, his face is quite clear after the still frames showing the reflection are processed using my RMS-UM image filter, allowing for a visible discernment of its teeth:
The filter over-amplified the green tendrils dripping down the wall obscure the demon's face somewhat......but can nonetheless be easily found by looking first at his very prominent right eye, and then to his toothy grimace
Note that both the blanket demon and the one above are facing upwards (towards the ceiling).

VIDEO | Hand-like, demonic tendril rises in front of TV

About this post (updated 8/29/2015)
Have you ever wondered, "Why do 'crazy' people always take their electronics apart?" Believe it or not, it's because they know it's their electronics that made them crazy—or something inside them, that is...


What I thought at first was just a part of the image on the TV, shown just outside the door in the room in which my video camera was set up, turned out to be a demonic tendril on closer inspection, which rose from either the console in front of the TV or from somewhere behind it:
What I thought was an image on TV turns out to be a demonic tendril, which rose from somewhere on top of the armoire
I processed a close-up with image-editing software in the following manner, in order to capture some of the tendril's details:
A still frame showing the tendril, processed by my mean-of-the-minimum-and-maximum (3x3, leveled)  imaging filter; it looks like a raw catfish steak
That helped some; but, a better way to distinguish the tendril from the image on the TV screen is to watch the video:



It appears to be the same weapon I detected in another video using the Ripple Effect filter that ships with Photo Booth (Apple) earlier this year, as first shown in Detecting live demonic activity using CCD sensors:


Both videos were made during periods of high demonic activity, and show a weapon used to slowly but surely degrade the health and appearance of (e.g., drain the life/give demons their jollies from...) its victims (e.g., ...the occupants of the my apartment), not to mention their mental health, as it most often strikes the head [see PHOTO | Close-up of tendril from hidden demonic weapon, lashing out].

The damage from these weapons is more severe to portions of your molecular make-up that are in a semi-cloaked state like the weapons themselves, and looks something like this:

The indentations on either side of my head (top, left and right) are actually there, but are not visible filtering the reflected light, and rendering an image from only polarized light
Those holes or indentations on the left and right of the top of my head are not perceptible to the human eyes as damage, so much as deformity or "just the shape of your head, which changes as you get older." By filtering from digital media the light reflected by the molecules you can see and then rendering an image using what's left over (i.e., the polarized light emanated by the semi-cloaked molecules, which is seeable, but is drowned out by the much more powerful and plentiful reflected light), you will be able to readily and easily distinguish between a point of impact and a natural change in bodily shape.