ModestyCamFX

September 2013

ModestyCamFX is a simple utility to (optionally) obscure a web camera image, and also interface with a Mitsubishi FX PLC over Ethernet to remote trigger the sending of an email with that image attached.

Preamble

I wrote this app to meet a specific personal requirement; we wanted to be able to observe a family member 24/7 in order to assist in the care package for their well-being. The idea was simple - capture an image from a web camera (or an image from file, when derived from another media source), then visually obscure it is some way in order to protect the family members modesty.

As the program developed it became apparent that we could also detect movement, in so much as, the weight of pixel color change within a specified area would concur so, and also that a very simple interface to a Mitsubishi FX PLC could also be tied in to trigger events such as emailing the modesty image and other information too. As a final caveat, it was clear that being able to view the modesty image remotely, over the Internet would be desirable, so ModestyCamFX outputs a simple HTML file that can be served from Windows inbuilt IIS Web Server if required.

ModestyCamFX - Image Effects

ModestyCamFX has various services:-

  • Web Camera Mode

  • Images From File Mode

  • Manual Edit Mode

In Web Camera mode you choose an attached Web Camera on program start, and it's images are utilised as the source for automatic processing. In Images From File mode the source images are acquired from a chosen file system folder, the intention being that those images are derived from an alternate imaging device, in our case, a FOSCAM IP Camera, and the images are FTP'd to that folder over our network. In Manual Edit mode you can simply open an image file, process it and then save it back to disc with an alternate file name (whereas the other modes may only pixelate the whole image, in this mode you may select the specific pixelation target areas with your mouse - for example, to obscure faces, etc.)

Other features variously include (depending upon mode):-

    • Whole Image pixelation

    • Adding of a Date / Time Stamp

    • Color Options, which include, to Grey Scale, to Black & White, to two tone user selected colors, and also full color inversion

    • Periodic saving of processed images to your file system

    • The selection of a single "Hot Spot" which may be used to determine activity

    • Hot Spot actions, which include, emailing of image, playing of a sound file and/or speaking a phrase through your PC using the Text to Speech Engine

    • Connection to a Mitsubishi FX PLC over Ethernet, which, with proper configuration, may in turn also trigger the email feature

    • Creation of a simple HTML web page, updated automatically

    • Multiple instances of ModestyCamFX can be started to allow processing from several image sources

Getting Started

When you first start the app you will be prompted to either select a Web Cam attached to your PC or not, in which case you'll be using the app in "Image File Mode"...

First Start Dialogue

If you choose to select a camera, and you actually one or more cameras installed on your system, then you will be greeted with the Windows built-in camera selection prompt...

Windows Camera Selector

(Note: Once you choose a web camera then ModestyCamFX will now run as a "top most window" on your desktop - this is required to satisfy the mechanism used to grab images and copy them from the device.)

Once the app starts you will see the streamed video feed minimized to the forms top left hand corner...

Camera Mode Started

The little image cannot be enlarged - this is a modesty camera application after all! =)

Next, lets look at the Edit Menu...

Edit Menu

Open Image

Use this to open an image, of any source and reasonable size, from your file system.

Save Image

Saves the current image in the large panel, formatted or otherwise, to disc after a prompt for a file path and name.

Copy Image

This actually copies the little image to the main panel and displays it full size. (Max. 640 x 480 pixel resolution.)

Process Image

Process the image in the big panel per the pixelation and other effects selected under Options.

Restore Image

Reverts all processing and changes on the image in the big panel back to the original image state.

Clear Image

Removes the image from the big panel - without any prompt for saving it either.

Select Hot Spot

When an image is loaded in the big panel, after choosing this option, you can drag your mouse to select the hot spot area.

Options

Opens the app wide options dialogue where you can set all manner of options.

So, for now, choose Copy Image or press Ctrl + C...

Little Image Copied To Big Panel (no modesty just yet!)

Next, open the options dialogue...

Options Dialogue

The Image Effects TAB provides access to the fundamental settings of how the app processes images. I'll just talk you through these controls...

Importantly, whilst the web camera (or file sourced) image may update frequently, for example every 500 milliseconds - your computer needs to work hard to process images, so the Camera Capture Interval should be set at a level high enough to allow images to be fully processed without errors.

If you want to apply a pixelation effect then check the box, and use the horizontal and vertical sliders to adjust the density of the effect. It's easy to test, just hit the [ Try Out ] button at any time. When you're saving processed images (or not processed for that matter) and you want to add a Date and Timestamp then check that box too. It adds a white text over red banner to the top left hand corner of the image. It also adds a warning when an image has been repeated - for example, when an image from the file system has not been updated since the last process.

Use the Color Options to choose the required effect, for examples...

GrayScale Effect

Black & White Effect

You get the idea, find an effect that suits your needs. Combining pixelation, color and a timestamp could yield...

Sample Full Effect

When you're done here press [ OK ] to return to the main form.

Now, to see how long your PC takes to process a real full size image choose Edit > Process Image or press Ctrl + P...

Process Time Feedback

From this example you can see that full effects took over 5 seconds to process, so we'd set the Image Capture Interval to perhaps 10 seconds to ensure that there is enough time to process each image without producing overlap errors.

To be continued...

Last Updated: 19th November 2013