|
|
Friends,I want to Segment selected region from the video frames, Say from the video frame 1 I selected an actor with no of mouse clicks(to identify the region boundry) manually, I am looking for good and algorithm/Fram Work which can segment it from the bacground or which can set all the pixel except the actor to white in all the rest of the frames
(C++ / C# or any..)
any smart idea pls
Thanx
|
|
|
|
|
work with WIN32 or GDI+ regions.
Create two region
1) Rectangular Frame Region (CreateRectRgn)
2) Segment Selected Region (CreatePolygonRgn)
Get the difference of region
CombineRgn(Frame, segment, RGN_DIFF)
Load the image to HDC
Then fill the difference region with FillRgn() of your choice color.
alternatively you can use SelectClipRgn() to clip the portion when you draw.
|
|
|
|
|
Thank you for responce, Well.. Filling the difference (RGN) will not segment the object from the bacground, For Example if a sequence of video frames contains a person walking in a forest, I want only walking person, to be in all the frames, Fill the rest of the region(forest) with some color.
Thanks
|
|
|
|
|
ptr_Electron wrote: Fill the rest of the region(forest) with some color.
and
ptr_Electron wrote: Filling the difference (RGN)
is this the same.
BTW, this works by the assumption that you find the region of the person manually (as you specified) in each frame.
ptr_Electron wrote: Filling the difference (RGN) will not segment the object from the bacground
what is the difference region, it is the background, if you fill the difference region it is filling the background.
|
|
|
|
|
Thanks for responce...but there is some displacement(any direction) in the forground and bacground object(rgn) also, in the next comming frames.. so I not quite clear... by the way May I know what BTW is..
|
|
|
|
|
ptr_Electron wrote: but there is some displacement(any direction) in the forground and bacground object(rgn) also
This requires some thing like "motion detection", i don't have experience in this. search and let others respond to it.
see also.
Motion_Detection[^]
ptr_Electron wrote: by the way May I know what BTW is..
By the Way
|
|
|
|
|
|
Hi
Win32 API in VC++ using VS6!
I am using ListView Control in my program .......everything is working fine......but the problem is when i select the Ist item the whole line(i.e Row) should get selected .....but it select only the item at Ist Row & Ist Column......
tell me how to do it
AbidBhat
|
|
|
|
|
missing LVS_EX_FULLROWSELECT style ?
|
|
|
|
|
|
Hello everybody,
how to allocate multi-dimensional pointer in c and c++?
what i mean by multi-dimensional pointer is: for example char**, or long***
<br />
Here is what i did. but i does not allocate memory properly.<br />
....<br />
char ** pString;<br />
1)first method<br />
pString = (char**)calloc(32*32,sizeof(char));<br />
1)Second method<br />
pString = new char[32][32];<br />
....<br /> both of them don't allocate memory properly.
Is there any other way to allocate multi-dimensional pointers?
thanks
It is never late to learn
|
|
|
|
|
in C (therefore C++), you could do this :
char matrice[10][10] = NULL;
matrice = malloc(10*10*sizeof(char));
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
matrice[i][j] = '\0';
}
}
of course, never forget to free the memory you allocated with malloc (and in C++, never forget to delete the memory you allocated with new ).
however, C++ provides built-in containers which are more secure when dealing with dynamically-sized arrays, and prevent from memory leaks...
for that, you may have a look at std::vector<> , std::list<> , std::deque<> , std::map<> ...
|
|
|
|
|
Thanks for reply,
Your method works for multi-dementional arrays, but that does not work for char **.
is there any other way to allocate type char**?
thanks
It is never late to learn
|
|
|
|
|
Gofur Halmurat wrote: 1)Second method
pString = new char[32][32];
pString = new char*[nFirstDimension];
for (int x = 0; x < nFirstDimension; x++)
pString[x] = new char[nSecondDimension];
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for your reply?
it helped to think that way in your code.
<br />
char** pString;<br />
pString = (char**)calloc(32,sizeof(char*));<br />
for(int i=0;i<32;i++)<br />
{<br />
pString[i]=(char*)calloc(32,sizeof(char));<br />
}<br />
do u think it is right what i did?
thanks
It is never late to learn
|
|
|
|
|
thanks everybody,
This method is working.
thanks
It is never late to learn
|
|
|
|
|
Hi,
I am having the below environment.
My application is running in machine A. It has an access database in the local machine and a connection will be established when the application starts and will end when the application exits. I am using CDatabase to connect to the DB.
I need to delete a record presents in the machine A database from machine B. To do this, i am creating a connection from machine B to machine A's database and executing the delete query. During the SQL execution, I am getting an error 'Could not update; currently locked by user admin...'.
The frequency of the error is often but not at all tries.
I welcome your ideas in resolving this issue.
Thanks in advance.
Selva
|
|
|
|
|
So does machine A have any part of the database open? When this error pops up, have you checked to see what process may have a file open?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
Yes. From machine A will always be holding a connection with the database until the application exits.
But Access supports shared access of DB. isn't it?
Moreover i am not getting the error at all tries. Only once in 3 or 4 times.
Is there any way of avoiding the locking of the records? i.e allowing two users to update the record at the same time..
I have got something from the web, where they ask to wait for some time and do the process again. But in my case even that doesn't workout.
Please see the link below.
http://www.dbforums.com/archive/index.php/t-525401.html[^]
Thanks
Selva
|
|
|
|
|
SelvaKr wrote: But Access supports shared access of DB. isn't it?
As far as I know it does. But you first need to determine what process has the file(s) open such that machine B cannot update them. Is it your application running on machine A, or some other application?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello everyone,
Here is my understanding of what Bjarne said in his The C++ Programming Language book. I am not sure whether my understanding is correct? I am somewhat confused about the following statements.
My understanding is,
means if a function call like this,
void func(const A a)
then compiler can deduce argument type of template function below to A?
template <class T> func (T a)
Bjarne's original statements are,
--------------------
C.13.4 Deducing Function Template Arguments
A compiler can deduce a type template argument, T or TT , and a nontype
template argument, I, from a template function argument with a type composed of the following constructs:
T const T volatile T
T* T& T[constant_expression]
type[I] class_template_name<T> class_template_name<I>
T T<T > T<I > T<>
--------------------
thanks in advance,
George
|
|
|
|
|
Yes, the only bit you're missing is the call to func
int i = 6;
func( i );
Now the compile can deduce that the call it to template<int> func(int a)</int> . In other words it works out the template types backwards from known matches with parameter types. Clever isn't it, just be glad you aren't implementing a C++ compiler
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thanks Matthew,
Question answered.
regards,
George
|
|
|
|
|
in a source file(.cpp and .h), how can I know it call the dll?
if it calls the dll, how can I make it call the static lib instead of dll, can anyone give me specific instruction about this topic?
|
|
|
|