sew some random twenty lines into faces

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

sew some random twenty lines into faces

Post by teobo »

Hi,
is there something completed known to unexplode some random twenty lines into faces in Freecad? I mean one could create an algo (which is then publish here..), but if there is existing something, it is better to not reinvent the wheel, rigth?
If there is none known, I gladly receive suggestion on how to do it. (;
Tia

here is my project (sample):
https://www.dropbox.com/s/97tewmq3hacb8 ... fcstd?dl=0

screenshot:
Image

Update:
Ok I uploaded the screenshot (picture below) to have it more juicy. ;) It is like a "mikado" puzzle: How to get the areas (faces) out of random lines' boundaries?
Attachments
150910Freecad_dfx_linestoface.jpg
150910Freecad_dfx_linestoface.jpg (6.8 KiB) Viewed 3036 times
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

Re: sew some random twenty lines into faces

Post by teobo »

Hello everybody,
an still with this problem and gathered infomation:
there are exactly 2 reach where human labor is to be automated.
1) where the thermal values are to be assigned among theses retrieved bodies from the compound in table, yes as well as the temperature values for some surfaces of that model
2) where there is retrieved: an in FEM speech: multibody in FC speech: a step compound 2D with multiple links.

Any way I attach each of these 3 files. This, however, is yes the preceding test function:

Code: Select all

   def [u]test__pdf_or_other_input_to_cvs_and_step_compound[/u](self):
	'''
	for automate user inaction:
	prepare csv data according to "as is" interface definitions
	'''
So the discussion goes to howto retrieve these information from a picture-file these days -within Ubuntu-Linux . Getting a real surrounding digitally represented is a common, everyday task to many freecaders as well as indicating and assigning material values to the found objects.
Question: What would be necessary to have a nowadays recognition software apparatus working for that?

So I would be grateful, if some one could share his experiences or opinions on the occasion case of a FC-Macro-tool programming.
And, yes, I could offer some endowment for contribution to free software, well maybe with any reputation luck that comes behind. (;

example files:
https://www.dropbox.com/s/xp0jinjls0qk9 ... e.csv?dl=0
Attachments
Model_3_Bodenplatte_mit_Etage_pdfconvert2.jpg
Model_3_Bodenplatte_mit_Etage_pdfconvert2.jpg (183.63 KiB) Viewed 2972 times
compoundstepdump.step
(20.1 KiB) Downloaded 61 times
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: sew some random twenty lines into faces

Post by microelly2 »

I'm working on reconstruction and maybe this can become (sometime) helpful for you.
The idea: import images, recognize lines and other patterns and generate helper objects to support further processing.
look at my youtube https://www.youtube.com/user/microelly/videos

And I will read your example ...
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: sew some random twenty lines into faces

Post by DeepSOIC »

Maybe my skyscraper generator can help?
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: sew some random twenty lines into faces

Post by DeepSOIC »

make_faces_for_teobo.FCStd
requires Lattice2 plug-in workbench
(33.72 KiB) Downloaded 70 times
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

Re: sew some random twenty lines into faces

Post by teobo »

microelly2 wrote:I'm working on reconstruction and maybe this can become (sometime) helpful for you.
The idea: import images, recognize lines and other patterns and generate helper objects to support further processing.
look at my youtube https://www.youtube.com/user/microelly/videos

And I will read your example ...
Hi you two, hi everybody
1) This is really new two me, seems that freecad has a foto-reconstructor yet, but without me noticing it. For things like that is lattice?!? Wow, unbelievable. OOps found that your module is named "reconstruction".
https://github.com/microelly2/reconstru ... ontools.py It is wonderful that such a thing is existing these days and I am very interested in deed. It seemingly comes with geodata support, but for all the measuring suffices math knowledge and occ. Wow. Gonna use it soon. Thank you.
1.1 But hey, what is about pcl. I wonder how you might go over it in fc, without opinion? What would be such an opinion? I feel pcl functionality laps into even the present task, does not it? Maybe it is time to ask here:http://www.pcl-users.org/
Gonna need some time to check all the material.
-
2) Here the question is not even 3D. Just .jpg 2D to .step 2D. What wound be the best "self recognition" free software solution or FC-Solution these days then? I think in something like this to automatize the human labor reach:
2.1 Set a rectangle where the table is expected and with ocr (ubuntu) read it top down order and sort in into a table representation.
2.2 program (!) recognition of the faces on the picture file and sorting them into a compound object.
3. for completeness the question is to be posed: Is there yet a standard in delivering multi body fem pieces I do not know of?

Point 2.1, 2.2 is where I really lack comprehension, so I would be glad for any pointer.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: sew some random twenty lines into faces

Post by microelly2 »

OpenCV is a powerful tool to analyse images.

https://youtu.be/V9GapOYxrXk

However there is a lot of experiments needed to learn (for me) how to "teach" the "machine learning".
I think it will be possible to scan drafts and reconstruct models in near future.

The data are already good enough to get lines and arcs.
128 good pathes with 27000 points from a 1 000 000 image.
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

Re: sew some random twenty lines into faces

Post by teobo »

Hey microelly2,
you have released about twenty strong videos about image recognition in the last month. I saw a few, but missed somewhat a moderation during the demos.
"Now we do this, - now we come to that." Well, if I see you do that whole advanced stuff, I could lance the question to you:

How do you see it, how is distance (plain) picture - (plain) topo-shape compound been done? I mean the most approximately you can with you wisdom so far?

How would _you do that then by this occasion, please?
(;
Tia
Ps:-found
import cv2
you use the opencv module from python and built a macro, which is hopefully running on strange machines.(?)
- So is it indiscrete to ask, how you came out to so much -amazing- image recognition the last days? (;
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: sew some random twenty lines into faces

Post by microelly2 »

Many of these short videos show the state of my current work and sometimes there is a discussion or feedback.

I was surprised about the good quality of the image processing tools in opencv. Opencv runs is open source and runs under windows and linux.
Scanning 3D in most cases delivers mesh models, but what we as CADer see are pattern like cubes, spheres, cylinders.
So the question for me is: How can I automate the recognition process. There are already lots of good and fast algorithms and in CAD we do not need the speed of the autopilot of a car. Finding lines, circles and other curves of degree 2 in pictures seems to be possible. At the moment I have circle arc detection with a ransac and an idea to combine hough line and ransac to find find real lines.

However I need a lot of experiment to get the best parameters. Next days I integrate opencv into my workbench. Then I can combine filters and test the parametric results.
The problem is to purge the noise of scanned and hand drawn images.

It's exciting to see, what is possible.
I fill my git repo with the daily results and if the solution becomes more stable I will make videos with comments too.

https://github.com/microelly2/reconstruction
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

Re: sew some random twenty lines into faces

Post by teobo »

Hi microelly2,
microelly2 wrote:Many of these short videos show the state of my current work and sometimes there is a discussion or feedback.
Well, I go for it.
Edit:http://freecadbuch.de/doku.php?id=story ... grammieren
You are about to write a story about - how to do image processing on freecad. :o -right now. :o ;) :D
EditEnd
I was surprised about the good quality of the image processing tools in opencv.

At the moment I lack a clear concept of "image processing". So you say it ran even better than other tools you know for it, rigth?
-Testing exactly what?
Opencv runs is open source and runs under windows and linux.
Scanning 3D in most cases delivers mesh models, but what we as CADer see are pattern like cubes, spheres, cylinders.
Well, these are in deed different levels of presentation.
So the question for me is: How can I automate the recognition process.

-Which recognition process, either "Scanning 3D" which is technique of scanner devices or photo recognition?
I guess now you speak of photo recognition, as remote sensor, right?
(Edit:Well, I see this is how contemporary course introduce the matter, too: Intro to Digital Image Processing (ECSE-4540) Lectures, Spring 2015
Rich Radke25 Videos27.423 AufrufeZuletzt am 02.08.2015 aktualisiert
Lectures from Spring 2015's offering of Introduction to Digital Image Processing (ECSE-4540)
by Rich Radke, Rensselaer Polytechnic Institute.

-Edit: I share that aim and I am keen to use your results soon for my own code.
EditEnd
There are already lots of good and fast algorithms and in CAD we do not need the speed of the autopilot of a car.
Finding lines, circles and other curves of degree 2 in pictures seems to be possible.
By now found in your videos two kind of recognition cases: the screenshot of the 4 FC blocks and photos of house.
To say a screenshot and a photo. The edge detection in photo is a thing with scientific algorithms, ok.
What, however, is about a screenshot edge detecting, which is more like even the present case.
At the moment I have circle arc detection with a ransac and an idea to combine hough line and ransac to find find real lines.
Question: What were the preferred choice simple_screenshot->FC Line?

def Test_screenshot_frontal_projection_2D_object_To_freecad_represented_2d_compound_objects(self)
1)I guess that the noise is not that strong as on photos. Maybe other edge detection methods need to used. I still do not know.
2)To combine once represented lines to a rectangle is then the next bet and one of another stage. I saw a function of the in your videos.
3)Give me the compound faces from 2) and one needs to assign what one had read from the "screenshot-table" -on bets to say heuristics.

If you or anybody could help me, on pointing me which functions to choose and /or which concepts to learn, thanks!
However I need a lot of experiment to get the best parameters. Next days I integrate opencv into my workbench.
Then I can combine filters and test the parametric results.
The problem is to purge the noise of scanned and hand drawn images.
use ransac! (;
It's exciting to see, what is possible.
I fill my git repo with the daily results and if the solution becomes more stable I will make videos with comments too.

https://github.com/microelly2/reconstruction
Of exactly which workbench do you speak?
It is not in the ppa community
http://ppa.launchpad.net/freecad-commun ... ol/main/f/
Can anyone install this workbench "reconstruction", I may ask, too.

def Test_photos_of_scenes_To_freecad_represented_placed_objects()
is it that what you are after? As a brick for example for an "autopilot"? So I get a picture.
Last edited by teobo on Sun Mar 13, 2016 7:23 pm, edited 7 times in total.
Post Reply