|
Thanks guys .
Sorry for the delay, had a few honey-does to work on.
I am not particular about using RGB, that is what comes out from the camera.
I am sure there is a stock DirectShow filter to conwert to Y.
Leon,
many thanks for the CCL. You did a fantastic job documenting, one does not see such professional coding often. I got it compiled and running. So far it bombs when the row dimension goes to 2 , somewhere it gets modified and ends up as -1. I am working on that.
Thanks again.
Cheers Vaclav
PS just for laughs – my “primary” application is to control model train two way “green wave”, the secondary is to identify notes on sheet and color them and eventually let the player know which note he played and …
|
|
|
|
|
Leon, this may be too early to ask.
It appears that when the trace starts( sx,sy) on cy = 2 than when it gets back to the starting point it decrements the cy by two. Should it stay in +- 1 range?
The bitmap[x][y] gets “illegal access “ = invalid pointer because there is no line 0 on it.
I'll force it to stay in +-1 to see if this is the issue.
Don't spent too much time on this, I am just starting and this may be false alarm.
I need to stop using the live feed and use one of yours bitmaps to make sure I am not messing up something else. (But I don;t have “read from file “ filter handy for now.)
Edit
The problem is with labelmap with y = -1. I should be able to find it, I probably missed something.
-- modified 4-Apr-14 12:00pm.
|
|
|
|
|
It's not a program issue it's a required structural issue of the raster process. You must maintain a one pixel border of background color around the image to vectorize it is covered in the reference paper. It is called a guard to stop the vectorize process going outside the area so if we use G for guard pixels and U for user bitmap image it must look like this
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUG
GUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUG
GUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUG
GUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
So hence your image must be placed starting at 1,1 and the guard pixels (background color) must be in place and you start the vectorizer at 1,1. The vectorize process searches one pixel up and across in all directions so the guard pixels are REQUIRED to stop the vectorize trying to go outside the array and definitely not optional.
You will note when I make a CCL_MAP it is always created bm.bmWidth+2, bm.bmHeight+2 to allow for the guard pixels and they are manually filled in to background color and the bitmap loaded to 1,1. Also make sure you guard pixel color is the background color and not the color you are scanning for.
Your violation error above can only come about because somehow you violated the guard pixel requirements which makes sure the raster process stays inside the array dimensions. That is the safest way to do the containment if you try limiting the array index itself you will find you have issues getting guaranteed closing of the shapes.
modified 13-Apr-14 9:29am.
|
|
|
|
|
Hi, anybody knows how to replace mode operation with Bitwise operation?
I mean any number, not just a number = 2^n;
for example, mod 7, mod 6 ...
Thanks
|
|
|
|
|
Bitwise operations only work for powers of 2, so mod 7 or 6 cannot be done.
|
|
|
|
|
|
Hi all! I have a serious problem with DATETIME in SELECT.
This is my code:
CRecordset recordset(&database);
CString query;
m_tabOnglet[0]->GetDlgItemTextW(IDC_DATETIMEPICKER1, datNaiss);
query.Format(L"SELECT numFROM personne WHERE datNais = '%s'", datNaiss);
recordset.Open(CRecordset::snapshot, query);
When I run the debbuger, it show message like this:
"incompatible data type in criteria expression"
|
|
|
|
|
Possibly the content of the DateTimePicker is not a string and can't be formated that way. Also it may be a problem that you are missing a space in front of the FROM in the query.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
"
When I run the debbuger, it show message like this:
"incompatible data type in criteria expression
"
Exactly in which line does show
By the naming convention
m_tabOnglet looks like a member variable of a tabcontrol.
|
|
|
|
|
Using the debugger, what is the value of query ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Dear all:
I use ReadFile api to read HID device synchronous.
My code show as below:
char preUsedSize = 0;
char curUsedSize = 0;
while(1)
{
opening_HANDLE = TestHid.ReturnHandle();
BOOL bGot = FALSE;
Data64_t aData64;
DWORD dwBytes = 0;
BOOL bSus = ::ReadFile(opening_HANDLE, aData64.raw,
sizeof(aData64), &dwBytes, NULL);
if( bSus )
{
PTOUCH_REPORT inputData = (PTOUCH_REPORT)aData64.raw;
curUsedSize = inputData->actualCnt;
if(curUsedSize > preUsedSize)
{
for(int i = 0; i<(curUsedSize - preUsedSize);i++)
{
Beep(0x7fff, 500);
}
}
preUsedSize = curUsedSize;
bGot = TRUE;
}
else
{
CloseHandle(opening_HANDLE);
}
if(!bGot)
{
Sleep(500);
}
}
My question is how do I clean preUsedSize and curUsedSize to 0,
If I did not get any data from my device(not get data failed)?
The FALSE of bSus means I get data from HID device fail, not no data income.
Thanks for your help, Victor.
|
|
|
|
|
Your question is not clear. It looks like you are asking how to set the variables preUsedSize and curUsedSize to zero.
To that, the answer is:
preUsedSize = 0;
curUsedSize = 0;
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I can't understand your question well.
Firstly, you read the file synchronous, so if no fails happens, it will be blocked here if no data income.
I think so, happy to communicate with you !
|
|
|
|
|
Hi All,
I have a wrapper class for the MS Office Products, last time I built it was way back for Office 2000.
I had a set of #imports for that version, but looking in the various directories seem to have changed a bit.
This is what I currently use, has anyone got an updated list for MS Office 2013?
Thanks,
<pre lang="vb">#import "C:\Program Files\Microsoft Office\Office\MSO9.DLL"
#import "C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB"
#import "C:\Program Files\Microsoft Office\Office\MSWORD9.OLB" rename("ExitWindows","_ExitWindows")
//#import "C:\Program Files\Microsoft Office\Office\EXCEL9.OLB" rename("DialogBox","_DialogBox") \
// rename("RGB","_RGB") \
// exclude("IFont","IPicture")
//#import "C:\Program Files\Common Files\Microsoft Shared\DAO\DAO360.DLL" rename("EOF","EndOfFile")\
// rename("BOF","BegOfFile")
//#import "C:\Program Files\Microsoft Office\Office\MSACC9.OLB"
|
|
|
|
|
I think if you generate files from a tlb the paths should automatically come up.
This is of Office 2010
#import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\MSO.DLL" no_namespace
A suggestion : Having developed several Office addins, and if you are also doing so, I shall strongly suggest you to use C# .
|
|
|
|
|
Hi Sujayg,
I am trying to create a *.lib file to wrap some of the Word Automation Functions.
So, tell me if I got this all wrong...
I created a Win32 project, selecting MFC and Static Library.
I used Add Class -> MFC Class From Typelib and selected File and used C:\\Program Files\\Microsoft Office\\Office15\\MSWORD.OLB
As I did not know which classes I would need, I just selected them all.
So it generated a lot of Class Header files.
I selected a few Header files for the classes I needed and added #includes for them.
The build created the msword.tlh file etc.
It also gave me over 100 errors, all due to missing items in the msword.tlh file.
In the Add Class step, should I just be selecting the MSWord classes I need, and not just all of them?
Or have I got this whole thing wrong?
It worked OK back in the days of Office 97 and 2000.
BTW, at this stage learning C# is not really an option.
Thanks,
Bryan.
|
|
|
|
|
The steps are correct and it worked fine in Office 2000. I had worked on Word automation in C++ / Office 2000 .
Yes, I could reproduce the errors. Probably we need to make some changes, for working on C++ / Office.
Have a look at [^] ; the steps in which the author makes a change to import. Also check the Word automation using C++ [^] - specially the Solution1.h/cpp and Solution1.h/cpp to view how imports are changed.
Let us know if it helps.
Sujay
|
|
|
|
|
|
Hello Bryan
Thanks for sharing the link as well. I commented the import statement, and it worked fine.
I have checked the functionality of the classes though.
Thanks
Sujay
|
|
|
|
|
I have an application ,need to read hardware IO, each IO data be coded to an unsigned integer, 4 digits - 7 digits.
Quantity of all possible integers is 240, every integer is unique
for example:
1000,1002, 120008, 1318001,14702 , 4003...
After coding step, the coded integers need to be send out in a sequence.
12002 <- 4001 <- 10089 <- 5007 <- ...
Quantity of integers are limited to 128, but, the quantity number is not fixed. Perhaps send-cycle1 is 4 integers,
send-cycle2 is 120 integers,
send-cycle3 is 2 integers,
send-cycle4 is 0 integer.
...
And during cycle period, maybe there are duplicated data be read,but, sending sequence should not take duplicated data.
Logic is :
read data -> already in sequence, discard/ new data -> sequence
I wonder what data structure is good for the above logic and application.
|
|
|
|
|
|
MCU platform, use Hahset is not a good choice.
|
|
|
|
|
In order to get better help you should detail your scenario. For instance, I have no idea of what you mean with
Quote: After coding step, the coded integers need to be send out in a sequence.
12002 <- 4001 <- 10089 <- 5007 <- ...
Veni, vidi, vici.
|
|
|
|
|
Sorry, I mean, I want to send 12007, then 5007, right number after left number.
|
|
|
|
|
Is it a LIFO pattern? In this case std::stack[^] is your answer
|
|
|
|
|