- Quick start
- Download
- Online manual
- Introduction
- Start Onvif programming
- C# Onvif.IP.Camera.Viewer
- C# Onvif IP Camera Viewer Git repository
- IP video camera viewer
- PTZ IP camera motion control
- Onvif network video recorder
- Motion detection and alarms
- IP camera to SIP video call
- Configure Onvif IP cam remotely
- Onvif IP camera video server
- Video stream on website
- Onvif Network Video Analytics
- Onvif IP Camera Manager
- Computer Vision Technology
- Motion recognition and analysis
- Object detection
- Object categorization
- Image Manipulation
- Introduction
- Brightness filter
- Channel filtering
- Contrast correction
- Gamma correction
- Greyscale effect
- Histogram equalization
- Rotate filter
- Invert colors
- Jitter
- Mirror effect
- Pixellate
- Rotate channels
- Hue modifier
- Salt and pepper noise
- Saturation correction
- Sepia effect
- Sharpen
- Simple posterization
- Water wave
- YCbCr
- Ozeki SDK for Linux
- Community
- Contact
- Product
- Search
- Commercial information
Get started
- Download the SDK
- Copy the C# code example into Visual Studio
- Build your IP Camera project
Did you know?
Did you know, that this SDK was used to build Ozeki Camera Recorder?
If you don't want to write code, it could be just what you need. Download it now from the follolwing page: Download Ozeki Camera Recorder.
Greyscale effect
In photography and computing, a grayscale or greyscale digital image is an image in which the value of each pixel is a single sample, that carries only intensity information. Images of this sort, also known as black-and-white, are composed exclusively of shades of gray, varying from black at the weakest intensity to white at the strongest.
Important: you should study this article in order to find out how to setup your Windows Forms Application correctly.
Figure 1 - Original image
Figure 2 - Modified image with greyscale effect
Windows Form |
MainForm.cs
using System; using System.Windows.Forms; using Ozeki.Camera; using Ozeki.Media; namespace ImageManipulation_WF { public partial class MainForm : Form { private ICamera _camera; private DrawingImageProvider _imageProvider; private MediaConnector _connector; private ImageManipulation _manipulation; private OzGrayscale _filter; public MainForm() { InitializeComponent(); _connector = new MediaConnector(); _imageProvider = new DrawingImageProvider(); // Create video viewer UI control // Bind the camera image to the UI control videoViewer.SetImageProvider(_imageProvider); _manipulation = new ImageManipulation(); _manipulation.Start(); _filter = new OzGrayscale(); } private void btn_Connect_Click(object sender, EventArgs e) { _camera = new WebCamera(); if (_camera == null) return; _connector.Connect(_camera.VideoChannel, _manipulation); _connector.Connect(_manipulation, _imageProvider); _camera.Start(); videoViewer.Start(); } private void btn_Add_Click(object sender, EventArgs e) { _manipulation.Add(_filter); } private void btn_Remove_Click(object sender, EventArgs e) { _manipulation.Remove(_filter); } } }
Code 1 Greyscale effect in C#
GUI
MainForm.Designer.cs
using System; using System.Windows.Forms; using Ozeki.Camera; using Ozeki.Media; namespace ImageManipulation_WF { public partial class MainForm : Form { private ICamera _camera; private DrawingImageProvider _imageProvider; private MediaConnector _connector; private ImageManipulation _manipulation; private OzGrayscale _filter; public MainForm() { InitializeComponent(); _connector = new MediaConnector(); _imageProvider = new DrawingImageProvider(); // Create video viewer UI control // Bind the camera image to the UI control videoViewer.SetImageProvider(_imageProvider); _manipulation = new ImageManipulation(); _manipulation.Start(); _filter = new OzGrayscale(); } private void btn_Connect_Click(object sender, EventArgs e) { _camera = new WebCamera(); if (_camera == null) return; _connector.Connect(_camera.VideoChannel, _manipulation); _connector.Connect(_manipulation, _imageProvider); _camera.Start(); videoViewer.Start(); } private void btn_Add_Click(object sender, EventArgs e) { _manipulation.Add(_filter); } private void btn_Remove_Click(object sender, EventArgs e) { _manipulation.Remove(_filter); } } }
Code 2 Greyscale effect GUI in C#
Related Pages
Conclusion
With the help of this lecture you can successfully implement greyscale effect with your C# camera application using the Ozeki Camera SDK.
FAQ
Below you can find the answers for the most frequently asked questions related to this topic:
-
What kind of developer environment is needed?
- Microsoft Visual Studio 2010
- Microsoft .Net Framework 4.0
- Internet connection
-
How can I get the URL of the camera?
You can get the URL from the producer of the camera.
-
I have not managed to build the solution. How to solve it?
- Please set the Target framework property of the project to .NET 4.0.
- You should add the OzekiSDK.dll to the references of the solution.
- Please import the missing classes.
Home > Online manual > Image Manipulation > Greyscale effect
Legal |
Privacy |
Terms of use |
6797 3.227.247.17 | 87.229.102.173 | Login |