The MASM Forum

General => The Campus => Topic started by: opmat on January 23, 2013, 02:23:07 AM

Title: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: opmat on January 23, 2013, 02:23:07 AM
This is to anyone who can help. I need all the idea I can get on this project, I'm new to Assembly Language but needs to get this assignment done.

"The project involves receiving 640 X 480 pixels  24 bit RGB color digital video from four CCTV camera. These four channels of video are to be resized to 320 x 240 pixels and displayed simultaneously on a 1280 X 960 pixel screen split into 4 display windows, Develop your display driver in SIMD assembly language"

I know I'm supposed to learn
1. how to receive the video input
2. how to compress 640 x 480 pixels video to 320 x 240 pixel
3. Positioning this videos on the screen

but I have no idea how to go about it. Any idea no matter how little is appreciated.

Thanks
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: Farabi on January 23, 2013, 02:36:09 AM
I dont know the "Magic" byte of your hardware but for resizing the picture you can use GDI and GDI plus. Give me the hardware port address,  the value to give the command to the hardware like sending data or read data and I can help you.
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: opmat on January 23, 2013, 02:53:12 AM
Quote from: Farabi on January 23, 2013, 02:36:09 AM
I dont know the "Magic" byte of your hardware but for resizing the picture you can use GDI and GDI plus. Give me the hardware port address,  the value to give the command to the hardware like sending data or read data and I can help you.

Hi Farabi!
I don't really understand what you meant by "Magic" byte. Can you please explain how I can get that?
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: dedndave on January 23, 2013, 03:30:44 AM
i wouldn't worry about a magic byte - lol
i would worry about how to write the device driver   :redface:
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: Tedd on January 23, 2013, 05:51:29 AM
You'll need to know how the camera will be connected (USB, Firewire, Serial, ..?) - then you can find out how to receive the stream of data (the encoded images.)
Then you'll need to find out what format the data is in so you can decode it into a usable form (pixels?)

Once you have a usable data format, resizing 640x480 to 320x240 can be very simple (take every second pixel from every second row) or more complex (average overlapping 4x4 blocks of pixels.)
If you resize 4 images to 320x240, arranged 2x2 would give a 640x480 area, but the screen is 1280x960, so this would only take up 1/4 of the screen ..?

Positioning the video output on the screen depends on how you're sending the output and what its encoding should be.
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: opmat on January 23, 2013, 08:46:18 AM
Quote from: Tedd on January 23, 2013, 05:51:29 AM
You'll need to know how the camera will be connected (USB, Firewire, Serial, ..?) - then you can find out how to receive the stream of data (the encoded images.)
Then you'll need to find out what format the data is in so you can decode it into a usable form (pixels?)

Once you have a usable data format, resizing 640x480 to 320x240 can be very simple (take every second pixel from every second row) or more complex (average overlapping 4x4 blocks of pixels.)
If you resize 4 images to 320x240, arranged 2x2 would give a 640x480 area, but the screen is 1280x960, so this would only take up 1/4 of the screen ..?

Positioning the video output on the screen depends on how you're sending the output and what its encoding should be.

I'm thinking of using four webcam connected via usb as a test case
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: Farabi on January 23, 2013, 12:35:33 PM
Quote from: opmat on January 23, 2013, 08:46:18 AM
Quote from: Tedd on January 23, 2013, 05:51:29 AM
You'll need to know how the camera will be connected (USB, Firewire, Serial, ..?) - then you can find out how to receive the stream of data (the encoded images.)
Then you'll need to find out what format the data is in so you can decode it into a usable form (pixels?)

Once you have a usable data format, resizing 640x480 to 320x240 can be very simple (take every second pixel from every second row) or more complex (average overlapping 4x4 blocks of pixels.)
If you resize 4 images to 320x240, arranged 2x2 would give a 640x480 area, but the screen is 1280x960, so this would only take up 1/4 of the screen ..?

Positioning the video output on the screen depends on how you're sending the output and what its encoding should be.

I'm thinking of using four webcam connected via usb as a test case

Did you lost the CD Driver or you built your own webcam? So Windows did not detected it automatically?
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: tenkey on January 23, 2013, 07:17:03 PM
What processors does the SIMD assembler target?
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: opmat on January 23, 2013, 07:47:27 PM
It's actually an assignment in my Assembly Language class

"The project involves receiving 640 X 480 pixels  24 bit RGB color digital video from four CCTV camera. These four channels of video are to be resized to 320 x 240 pixels and displayed simultaneously on a 1280 X 960 pixel screen split into 4 display windows, Develop your display driver in SIMD assembly language"

I'm targeting 32-bit Processors
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: hfheatherfox07 on January 23, 2013, 07:55:27 PM
@tenkey
Well .....SIMD is not an assembler , rather instruction type
Google is amazing ... SIMD Definition :

http://en.m.wikipedia.org/wiki/SIMD

Please read about "SIMD instructions"
Under Instruction types
Here:

http://en.m.wikipedia.org/wiki/X86_assembly_language


@opmat
You mentioned that you are a bigner , not sure what that means ( what level you are at?)

If you a bigner to assembler in MASM ( note there are other like:
TASM NASM FASM ...)
May I suggest learning some basics from
http://win32assembly.programminghorizon.com/tutorials.html


We do have some app examples for webcam capture
http://www.masmforum.com/board/index.php?PHPSESSID=786dd40408172108b65a5a36b09c88c0&topic=6271;prev_next=next

http://masm32.com/board/index.php?topic=429.15

They are very advanced , at least for me at this time,
I have another example that I know works in capturing webcam, I would have to dig it up...
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: hfheatherfox07 on January 23, 2013, 08:55:41 PM
Quote from: dedndave on January 23, 2013, 03:30:44 AM
i wouldn't worry about a magic byte - lol
i would worry about how to write the device driver   :redface:

lol
KmdKit.zip would be a good start ....
But as far as I know a device driver helps operate the device like a printer driver for example ....( basically to identify the webcam to the computer and let know it is there , and register it to a port in the device manager
)
I posted a link to the example that you uploaded of the software ....
If opmat wants to show a video won't that be an application , and not a driver?

That will be pretty hard to write a device driver for that specific web cam...
opmat will have to contact the manufacture for specs...

Wouldn't opmat need to contact the web cam manufacturer for specs to write a device driver?


Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: dedndave on January 24, 2013, 12:06:11 AM
if the USB is configured as a serial device, it isn't as bad as i thought it'd be
no device driver needed
but, you still need the data format   :P
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: hfheatherfox07 on January 24, 2013, 05:09:43 AM
In any case ,
the links to those examples you posted are what opmat needs  :t
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: Farabi on January 24, 2013, 09:24:16 PM
Opmat, did youre lecture gave you something like book or something. And also, carefull, read the rules, this is your homework. And we cant help you for this.
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: dedndave on January 24, 2013, 09:25:31 PM
free advice is almost always available - lol
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: Farabi on January 24, 2013, 09:34:01 PM
Quote from: dedndave on January 24, 2013, 09:25:31 PM
free advice is almost always available - lol

Sometime not me  ;)
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: Farabi on January 25, 2013, 01:22:40 PM
I had 2 camera attached to my laptop, I can acess both, but not programatically, I need user interaction. Maybe people here know how to use VFW32 to do this programatically? Both are at location index 0 based on the device manager, which mean it share the same line, at USB.

I can access it programatically by using third party library like OpenCV but I want to know how to use VFW32 for this since OpenCV use it too.

(https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-ash3/560802_4569600358133_197801413_n.jpg)
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: Farabi on January 29, 2013, 11:21:39 AM
(https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-ash3/150665_4595704690725_361528482_n.jpg)

When I first plugged my Glasses to my laptop, the OS did not recognize what it was. It even told me that there is some trouble on my hardware. But dont give up yet. Take a look at the device manager, the question mark one, make sure it was your device by unpluging it and pluging it again. Take a look at what Windows can read from the Chip. It is the Vendor ID and the Product ID. My hardware vendor is unknown, but it used a known processor known as syntek. Just type the Vendor ID and the Product ID on google, and you can find the driver to suit your need. It worked for me. Now, I can use my glasses on my laptop as a webcam.

The problem is, when I plugged my glasses and my bluetooth together, my glasses run out of bandwith. So, for some system, make sure you have enough bandwith for multiple USB device. I only able to run 2 cameras at once without bluetooth device. Never tried more of it.
Title: Re: Help on CCTV Camera Driver (SIMD Assembly Language)
Post by: t4joseph on February 03, 2013, 04:49:30 AM
 ::) This obviously is a compound program, that on a good day should be written by a number of individuals.  May I ask, how many of you have been assigned to write this program or is it individually. 
Have you tried reading an image file first.  That will give you a head start...
Tips for reading image file and displaying it on screen:
a. read picture file into memory
b. Load picture file from memory handle into an Ipicture pointer
c. release the image to screen

just a thought...hope it helps