Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have Emgu image:

C#
Image<Bgr,byte> image = new Image<Bgr,byte>("image.jpg"); 


All pixels that inside green triangle I want to copy to the new image called:

C#
Image<Bgr,byte> copiedSegment;


Any idea how to implement it if I have coordinates of the green triangle contour.

Thank you in advance!
Posted
Updated 29-Nov-13 12:54pm
v4
Comments
Richard MacCutchan 29-Nov-13 14:57pm    
What a pity that the green triangle is invisible.
[no name] 29-Nov-13 18:42pm    
lolz

Before seeing your post, I'd never heard of the Emgu CV library for .NET. In less than one minute browsing their web-site I found a code example of shape detection, including the ability to recognize a triangle [^].

So: why can't you use the Emgu facility to achieve your goal ?
 
Share this answer
 
Well considering that the green triangle will only show up with your x-ray eyes.

(GENERAL ANSWER BECAUSE THERE IS NO TRIANGLE)
If you have the three points of the triangle you can simply create a bitmap with an area that will satisfy the triangle. Assumming that the color green is the same. You can filter out everything that isn't the same color of the triangle making it transparent. The rest will be the magical triangle.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900