Solved

Unable to control photo size of camera image

Posted on 2014-12-08
12
230 Views
Last Modified: 2014-12-25
I have developed a desktop application in VB.Net.

The application takes a photo from the camera installed on the PC and stores the image in a folder.

On my test system, I have a Logitech Web Cam Pro 9000. When I take the photo, the image is quite large (almost 1600 px wide).

When I deploy this to the Surface Pro 3, the photo image size is quite small (640px wide). The surface Pro inbuilt camera supports very large photo sizes when taken directly from the OS. However, I am unable to change or control the image size in my application.

How can I get the camera to take larger photographs?
0
Comment
Question by:RTKHOT
  • 6
  • 6
12 Comments
 
LVL 26

Expert Comment

by:Nick67
ID: 40497345
You have posted no source code, which is a direct contributor to no one taking up your question.
Much will depend on how you've coded things and what driver the Surface camera supports.
There is syntax is the libraries associated with cameras to specify sizes, but the syntax must be sussed out, and then tested to see if the driver supports such calls.

Can you post your code?
0
 

Author Comment

by:RTKHOT
ID: 40497647
Thanks for the reply. I will post code on Monday
0
 

Author Comment

by:RTKHOT
ID: 40502040
We are using "DirectX.Capture.DLL" for capturing photos from webcam.

"Size (1600, 1200)" works and capture photos if camera is Logitech.

But on surface pro if i set size as (1280,1024), still it takes saves photo with (640,360) size.

We need this or a sufficiently large sized photograph. The exact dimensions are not very important. However, 640,360 is too small.


            CaptureInformation.CaptureInfo.FrameSize =  New Size(1280, 1024)
            Rate = 3000
            CaptureInformation.CaptureInfo.FrameRate = Rate
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40503611
Ok, the Surface Pro 3 is supposed to have 1080p cameras front and back, so try
           CaptureInformation.CaptureInfo.FrameSize =  New Size(1920, 1080)
             Rate = 3000
             CaptureInformation.CaptureInfo.FrameRate = Rate

and see if that will go

The driver will ignore any invalid input and give you the default, which is clearly 640x 360.
But too, Rate = 3000 gives me the idea you are taking more than a one-off still shot.
If the driver thinks you are requesting video, that too is a different ball of wax
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40503627
But look here
The DirectX.Capture.DLL may not play well!
http://www.codeproject.com/Tips/559437/Capturing-Video-from-Web-camera-on-Windows-and-by
0
 

Author Comment

by:RTKHOT
ID: 40508603
Thank you. Since it is the holiday season, i will need a few more days to try this and get back to you. Appreciate the patience!
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:RTKHOT
ID: 40512826
1) We are capturing photos, not video
2) The default size of surface camera when taken directly from OS is 2592 x 1728
3) when taking the photo using our app code, it always creates a photo of 640 x 360 irrespective of the size that we mention in our code
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40513812
Have you looked at the link:
After starting to use the Win8-Desktop, I found that some old technologies do not work well, especially DirectShow. For instance, capturing of live video from web-camera by DirectShow works perfect on WinXP, Vista, Win7, and allows to get the specific resolution. For example, from Microsoft Life Studio Web-Camera, I can get video with 1080p. However, on Win8-Desktop, I can get only a 640x480 video. The fact is that the function in the line code, which on Win7 returns HRESULT - S_OK returns FAILED on Win8-Desktop.

This may be the problem.
Is your test/dev unit Windows 7?
0
 

Author Comment

by:RTKHOT
ID: 40514487
Test and development unit is windows 7.

Deployment Unit is Surface Pro 3

I did look at the link. It seems to be for Video. We are only taking photographs.

Am I missing something?
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40515159
What is video but a stream of pictures and audio?
You are using "DirectX.Capture.DLL"
That may or may not be the source of the problem, but if it is impaired for video, it is likely impaired for still photographs as well.

Look here
https://code.msdn.microsoft.com/windowsapps/CameraCaptureUI-Sample-845a53ac
There's a VB.Net sample to work with.
This is using a very different library than your attempt -- likely because of the issues I've noted -- which is that MS can't make their minds up about an API and keep supporting it.

The wheel keeps being re-invented
https://code.msdn.microsoft.com/windowsapps/Media-Capture-Sample-adf87622
0
 

Author Comment

by:RTKHOT
ID: 40518096
The code examples given above appear to be for win 8 apps.

Our dev environment is windows 7. we are deploying it on windows systems that include a surface pro 3
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 500 total points
ID: 40518169
And a Surface Pro 3 is running Win 8.1
So you are surprised that it doesn't work?
You must develop for your target -- which does not seem to support the library you are targeting in the same way as it does on Win 7.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article shows how to convert a multi-page PDF file into multiple image files, with one image file created for each page of the PDF. It does this by utilizing an excellent, free software package called GraphicsMagick. The solution is amazingly s…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…
The goal of the tutorial is to teach the user how to add a water mark to there photo. Once you have a photo you like you have to go into the water mark setting and add a water mark to the image. You can either choose a text watermark or an image…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now